Subject: Re: Direct TCP/IP proxying SSH server

Re: Direct TCP/IP proxying SSH server

From: Pan K via libssh2-devel <libssh2-devel_at_cool.haxx.se>
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" <peter@stuge.se>:

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
    correct?


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
program.


//Peter
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2017-12-07