libssh2 port forward

Posted by Evan D on Stack Overflow See other posts from Stack Overflow or by Evan D
Published on 2010-06-17T15:46:35Z Indexed on 2010/06/17 15:53 UTC
Read the original article Hit count: 664

Filed under:
|

In extension of this question http://stackoverflow.com/questions/1580750/example-code-of-libssh2-being-used-for-port-forwarding I was wondering if there's an "easier" way to connect to the locally binded addr:port.

From the link: you bind a remote port and list it locally, you accept incoming data from the port and send it to another socket (namely the local addr:port), after which I'd like to connect to the local addr:port. Is there a way to skip the "send it to another" step and direct the data directly for my "connect to localhost" ?

There are two parts to why I want this, first, it seems excessive, and in the spirit of piping, I wouldn't be surprised if it was possible. Second, since I'm trying to connect to a localhost'ed bound port forward, all code is in the same thread, making a continiously getting data->sending data, and polling the sending data from another socket, a bit tricky.

Thanks in advance,

  • Evan

© Stack Overflow or respective owner

Related posts about portforwarding

Related posts about libssh