Subject: Re: Direct tcp ip channel - session handshake

Re: Direct tcp ip channel - session handshake

From: Peter Stuge <>
Date: Sun, 23 Sep 2012 15:09:43 +0200

Jiri wrote:
> > What is your question exactly?
> My goal is to connect to the PublicHost and from there to the InternalHost
> - thus creating a connection to the host in a local network while working
> with it as during the connection to a public server. I have created a
> connection to the PublicHost, there listensocket (set to a non-blocking
> mode) and direct tcp channel were established. Then
> I create connection to the "localhost" with a redirected port
> created as well as the session

You must have two sessions of course. You haven't posted code so I
don't know, it's not clear from your explanation.

> but the program stops during handshake.

Then you are simply not correctly passing data across the three
connections that your application has open.

> I would like to know if there is any general procedure of
> how to achieve this using libssh2.

The direct_tcpip example is as close as you get. It shows what you
need to do.

Received on 2012-09-23