This is a discussion on Local port forwarding using libssh - SSH ; Hi, Has anybody forwarded a local port to a mysql port using libssh? I have the following problem while doing so. I am creating a channel and forwarding it to a mysql port (using channel_open_forward() ). The problem is after ...
Hi,
Has anybody forwarded a local port to a mysql port using libssh?
I have the following problem while doing so.
I am creating a channel and forwarding it to a mysql port (using
channel_open_forward() ).
The problem is after forwarding to mysql the channel will have some
data to read (Like mysql server version, etc).
I am reading that from the channel and writing into the local port.
Then the local port will have some data to be forwarded to the mysql
server.
I need to read this and write it into the forwarded channel.
This time it fails.
I can not write the data (read from local port) in to the previous
channel. I need to create a new channel.
Even new channel wont work! This situation keeps repeating.
What is the standard way to achieve this?