Subject: Re: [libssh2] Tunneling?

Re: [libssh2] Tunneling?

From: Sabyasachi Ruj <ruj.sabya_at_gmail.com>
Date: Tue, 8 Jan 2008 15:56:35 +0530

Sorry, I mean after the first cycle (read channel -> write in socket-> read
from local socket -> write in channel), when I try to read again
     readbytes = libssh2_channel_read(channel,dtbuf,4096);
fails.
This returns -37 LIBSSH2_ERROR_EAGAIN continuously.
None of them (the local socket and the forwarded channel has the data!).

On Jan 8, 2008 12:56 PM, Sabyasachi Ruj <ruj.sabya_at_gmail.com> wrote:

> Yes. You are correct. It works with those steps in Linux.
> But in windows once I have read from the forwarded channel and written the
> response from my local socket to the channel, I am not able to read from
> that channel further.
>
> readbytes = libssh2_channel_read(channel,buf,4096);
>
> The above function returns -37 which is LIBSSH2_ERROR_EAGAIN continuously.
>
>
>
> On Jan 8, 2008 11:04 AM, Paul Thomas < thomaspu_at_gmail.com> wrote:
>
> > Yeah, what I'm going for is to be able to use the tunnel so another
> > local application can use this channel.
> >
> > So, I'm guessing then that what I should do is create the connection
> > with _direct_tcpip... and then I create a socket on the same machine
> > with the local port I want their local application to connect to. I
> > then listen on that port. When that port receives data...I write that
> > to the channel? Likewise when that channel recieves data, i write it
> > to the local socket?
> >
> > Paul
> >
> > On Jan 7, 2008 11:29 PM, Peter Stuge <peter_at_stuge.se> wrote:
> > >
> > > On Mon, Jan 07, 2008 at 10:49:08PM -0500, Paul Thomas wrote:
> > > > Yeah, I'm asking for help again ;p Is there more to setting up a
> > > > TCP/IP tunnel then just calling libssh2_channel_direct_tcpip_ex()
> > > > with the needed information? I'm trying to get tunneling working
> > > > and haven't had any luck so far. The function returns a valid
> > > > channel instance, but I'm unable to connect to my specified 3rd
> > > > party.
> > >
> > > _direct_tcpip_ex() will ask the server to connect to the specified
> > > port, and the way I understand the code the returned channel is what
> > > you'd use for talking to the remote server.
> > >
> > > Ie. the channel is the TCP/IP connection.
> > >
> > > If you want to tunnel or proxy to let another local application use
> > > this channel, you have to create the socket and so on in the client.
> > >
> > > Does this answer your question? What is your goal with this tunnel?
> > >
> > >
> > > //Peter
> > >
> > >
> > -------------------------------------------------------------------------
> > > Check out the new SourceForge.net Marketplace.
> > > It's the best place to buy or sell services for
> > > just about anything Open Source.
> > >
> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> > > _______________________________________________
> > > libssh2-devel mailing list
> > > libssh2-devel_at_lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/libssh2-devel
> > >
> >
> > -------------------------------------------------------------------------
> >
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> >
> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> > _______________________________________________
> > libssh2-devel mailing list
> > libssh2-devel_at_lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/libssh2-devel
> >
>
>
>
> --
> Sabyasachi

-- 
Sabyasachi

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-01-08