cURL / Mailing Lists / curl-library / Single Mail


RE: Implementing protocols with curl sockets

From: Roman Kubiak <>
Date: Thu, 30 Apr 2009 17:35:44 +0200

Ah yes CURLOPT_HTTPPROXYTUNNEL is the option I was looking for because it
does the CONNECT method on the http proxy, but does this option work for
SOCKS proxy servers ? or is it http proxy specific ?

-----Wiadomość oryginalna-----
[] W imieniu Daniel Stenberg
Wysłano: Thursday, April 30, 2009 12:10 AM
Do: libcurl development
Temat: Re: Implementing protocols with curl sockets

On Wed, 29 Apr 2009, Roman Kubiak wrote:

> The question is how can i pass a connected, proxy aware socket to libssh2
> using curl. I mean i want a connected socket but not to the proxy only but

> to the end host, with all the proxy stuff done.

Well, you then need proxytunnel or similar enabled since a proxy by
is terminating the connection a client makes, and the proxy then makes the
rest of the communication for the client to the remote server.

> I thought of using the http protocol but i dn't think i can force curl
> to zero all sent data

You shouldn't allow libcurl to send anything, use CURLOPT_CONNECT_ONLY,

> Perhaps you could expose the libssh2 session handles with curl_getinfo()
> that i can use that to do some nasty stuff.

Uhm, yeah that would be an alternative. To allow CURLOPT_CONNECT_ONLY with
or SFTP and then have a feature similar to CURLINFO_LASTSOCKET that instead
returns the libssh2 session handle. But I'm really not liking the thought of

having that ability in the API. I think it's bad enough already that we can
export the "raw" socket like this...

Received on 2009-04-30