Subject: Re: Direct TCP/IP proxying SSH server

Re: Direct TCP/IP proxying SSH server

From: Pan K via libssh2-devel <>
Date: Thu, 07 Dec 2017 11:22:45 +0000
Perhaps my question was not clear.
In my testing and from libssh2 example code, I have not seen anywhere handshake or auth being used in non-blocking mode. If set_blocking(0) is set on a session prior to handshake or auth, both handshake and auth fail with either socket timeout or error -43 (socket recv error). EAGAIN is never returned by either handshake or auth.
Are there any examples of both handshake and auth being with session already in non-blocking mode?
Data in tunnel already flows correctly, as tested with 'nc' server and listener. The issue is with using session handshake and auth in non-blocking mode.
Thanks for the feedback.

05.12.2017, 23:23, "Peter Stuge" <>:

Pan K wrote:

 "Must use non-blocking IO hereafter due to the current libssh2 API"
    If I understand correctly, this means that direct TCP/IP forwarding
    cannot be used to proxy another SSH server that will be connected to
    with libssh2 via the forwarded connection. Is this understanding

No. You can do what you want, but *you* have to ensure that data flows.

Non-blocking is required if you want to do that in a single-threaded


Received on 2017-12-07