Subject: Re: libssh2_channel_direct_tcpip_ex

Re: libssh2_channel_direct_tcpip_ex

From: Me Me <decay40_at_gmail.com>
Date: Wed, 16 Dec 2009 13:52:04 -0500

On Wed, Dec 16, 2009 at 11:50 AM, Peter Stuge <peter_at_stuge.se> wrote:

> Me Me wrote:
> > I am trying to tunnel a MySQL connection thru
> > libssh2_channel_direct_tcpip_ex.
> ..
> > Once I have the channel, do I need to do anything with it?
> > The MySQL client should take over from there with the
> > communication, since it handles all the sockets, and I should just
> > be able to give it 127.0.0.1 and it should connect. Am I
> > completely misunderstanding the way this works?
>
> Somewhat. You need to socket(), bind(3306), listen() and accept(),
> and for each connected client you then create a direct-tcpip channel.
>
> host,port=127.0.0.1,3306 (relative the SSH server side)
> shost,sport=info from the addr returned by accept()
>
> Then you pump data between channel and socket. Lots of fun.
>
>
Peter,

So does that mean I have to skip using the MySQL client library completely,
and manipulate the raw communication from the server myself, as opposed to
just connecting to a local port that is being forwarded from the server?

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-12-16