cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using libCurl over SSH Tunnel

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 13 Apr 2010 14:06:37 +0200 (CEST)

On Mon, 12 Apr 2010, Jérôme Patey wrote:

>> I was more thinking about you setting up a tunnel like:
>>
>> "ssh -L 8080:[remotehost]:80 [sshserver]"
>>
>> and then you point libcurl to the site, as you would with curl like:
>>
>> curl -H "Host: [remotehost]" http://localhost:8080/[rest of url]

Uhm, in fact you probably even better do this:

  ssh -D 8080 [sshserver]

As that will make OpenSSH do a SOCKS-proxy for you over that tunnel. With that
up, you just point libcurl to use localhost:8080 as a socks proxy,

> Yes, that would be good... but how can I do that programmatically ?

The ssh parts would be a plain OpenSSH command invoke, and the libcurl code
would be just regular libcurl code using a proxy.

--
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-13