cURL / Mailing Lists / curl-library / Single Mail


Using libCurl over SSH Tunnel

From: Jérôme Patey <>
Date: Mon, 12 Apr 2010 16:40:09 +0200


I wanted to use libCurl over a SSH proxy. That is, I connect to
the remove server using SSH, then create a tunnel, and I want to use the
resulting socket in libCurl.

I am using libssh2, and functions are
provided to create a tunnel. Then, I have a custom_read() and
custom_write(), which "encrypt" the data and send them on the other side of
the server, the "decrypt" the data, as if there was no SSH.

The problem
is that I don't know where to replace the socket_read and socket_write
which are hardcoded everywhere in libCurl... so I wanted to know if anyone
had an idea about that.

I want to use HTTP and HTTPS.

My question is:

libCurl gurus, do you know which function of libCurl I can override so
that all read/write on the socket go through my functions ?

In fact, I
want to do something quite similar to the SOCK5 proxy... but over SSH
instead of SOCK5.

Thanks a lot!

Jérôme Patey -

List admin:
Received on 2010-04-12