[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tunneling
  [Thread Prev] | [Thread Next]
 
 
- Subject: Re: Tunneling
- From: Dustin Oprea <myselfasunder@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 27 Nov 2013 14:36:29 -0500
- To: libssh <libssh@xxxxxxxxxx>
- Cc: Joao Pedro Almeida Pereira <joao.almeida@xxxxxxxxxxx>
On Wed, Nov 27, 2013 at 12:11 PM, Andreas Schneider <asn@xxxxxxxxxxxxxx>wrote:
> On Wednesday 27 November 2013 15:59:07 Joao Pedro Almeida Pereira wrote:
> > Hello,
> > So basically i need to do
> > rc = channel_open_forward(forwarding_channel,
> > "HostB", 22,
> > "localhost", 5555);
> > sock = create_socket("localhost",5555)
> > con_sock = wait_for_client( sock )
> > while true:
> > if have_things_to_read( con_sock ):
> >
> > size_data = read_from_socket( con_sock, data_from_socket )
> >
> > channel_write(forwarding_channel, data_from_socket, size_data )
> >
> > else if have_things_to_read( forwarding_channel):
> >
> > size_data = channel_read( forwarding_channel, data_from_server)
> >
> > size_data = write_to_socket( con_sock, data_from_server )
> > else:
> > sleep(0.1)
> > Something similar to this with all the control logic in order to handle
> the
> > case of errors.
> >
>
> http://git.libssh.org/projects/libssh.git/tree/examples/proxy.c
>
> :)
>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> www.cryptomilk.org                asn@xxxxxxxxxxxxxx
>
>
>
There's also a very similar example online at
http://api.libssh.org/master/libssh_tutor_forwarding.html .
It basically agrees with yours (except they just use a constant literal as
the source data).
Dustin
| Tunneling | Joao Pedro Almeida Pereira <joao.almeida@xxxxxxxxxxx> | 
| Re: Tunneling | Dustin Oprea <myselfasunder@xxxxxxxxx> | 
| Re: Tunneling | Joao Pedro Almeida Pereira <joao.almeida@xxxxxxxxxxx> | 
| Re: Tunneling | Andreas Schneider <asn@xxxxxxxxxxxxxx> | 

