Hi,
I'm not sure, but that does not seem like the right way to do it. The program
will run on the pc's with the shipview servers, so I imagined this:
1. connect() to the middleman server2. request that the middlemen server
listens to port 5907 with ssh_channel_listen_forward()3. Create channel to
localhost:5900 with ssh_channel_accept_forward()4. ???
Please tell me if this is the correct way to do this.
Kind regards,Lars van Ruiten
> From: [email protected]
> To: [email protected]
> Subject: Re: SSH reverse tunnel
> Date: Thu, 24 Sep 2015 12:03:15 +0200
>
> On Thursday 24 September 2015 09:40:18 lars van ruiten wrote:
> > Hi,
> > Is there an example available of a fully function reverse SSH tunnel written
> > in libssh? I need to set up a VNC server. The system should work like
> > this:VNC client connects to a server on port 5907. That port needs to be
> > redirected to port 5900 of a VNC server which can't be accessed directly
> > due to the fact that it is part of a local network and is behind a NAT. So
> > I'm trying to write a program that connects to the middleman-server and
> > requests that it listens on port 5907 and redirects all that data to port
> > 5900 on the local computer. Can someone give me an example of how to
> > achieve this? The reverse port forwarding example in the tutorial handles
> > the request by itself and I can't figure out how I should redirect the data
> > to a local port.Any tips/advice/help would be really appreciated. An
> > example program would be totally awesome. Cheerio
>
> You connect() to localhost:5900
>
> Then handle the the reverse channel ...
>
> ssh_channel_read() -> send()
> recv() -> ssh_channel_write()
>
> --
> Andreas Schneider GPG-ID: CC014E3D
> www.cryptomilk.org [email protected]
>