[prev in list] [next in list] [prev in thread] [next in thread]
List: libssh2-devel
Subject: Re: [libssh2] Tunneling?
From: "Sabyasachi Ruj" <ruj.sabya () gmail ! com>
Date: 2008-01-08 7:38:39
Message-ID: 62afdb660801072326x444f1947laa5a17aab44ed265 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@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@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@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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libssh2-devel
>
--
Sabyasachi
[Attachment #5 (text/html)]
Yes. You are correct. It works with those steps in Linux.<br>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. <br><br>readbytes = \
libssh2_channel_read(channel,buf,4096);<br><br>The above function returns -37 which \
is LIBSSH2_ERROR_EAGAIN continuously.<br><br><br><div class="gmail_quote">On Jan 8, \
2008 11:04 AM, Paul Thomas <<a href="mailto:thomaspu@gmail.com"> \
thomaspu@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;">Yeah, what I'm going for is to be able to use the tunnel so \
another <br>local application can use this channel.<br><br>So, I'm guessing then \
that what I should do is create the connection<br>with _direct_tcpip... and then I \
create a socket on the same machine<br>with the local port I want their local \
application to connect to. I <br>then listen on that port. When that port receives \
data...I write that<br>to the channel? Likewise when that channel recieves data, i \
write it<br>to the local socket?<br><font \
color="#888888"><br>Paul<br></font><div><div> </div><div class="Wj3C7c"><br>On Jan 7, \
2008 11:29 PM, Peter Stuge <<a href="mailto:peter@stuge.se">peter@stuge.se</a>> \
wrote:<br>><br>> On Mon, Jan 07, 2008 at 10:49:08PM -0500, Paul Thomas \
wrote:<br>> > Yeah, I'm asking for help again ;p Is there more to setting \
up a <br>> > TCP/IP tunnel then just calling \
libssh2_channel_direct_tcpip_ex()<br>> > with the needed information? I'm \
trying to get tunneling working<br>> > and haven't had any luck so far. The \
function returns a valid <br>> > channel instance, but I'm unable to \
connect to my specified 3rd<br>> > party.<br>><br>> _direct_tcpip_ex() \
will ask the server to connect to the specified<br>> port, and the way I \
understand the code the returned channel is what <br>> you'd use for talking \
to the remote server.<br>><br>> Ie. the channel is the TCP/IP \
connection.<br>><br>> If you want to tunnel or proxy to let another local \
application use<br>> this channel, you have to create the socket and so on in the \
client. <br>><br>> Does this answer your question? What is your goal with this \
tunnel?<br>><br>><br>> //Peter<br>><br>> \
-------------------------------------------------------------------------<br>> \
Check out the new SourceForge.net Marketplace.<br>> It's the best place to \
buy or sell services for<br>> just about anything Open Source.<br>> <a \
href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace" \
target="_blank"> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</a><br>> \
_______________________________________________<br>> libssh2-devel mailing \
list<br>> <a href="mailto:libssh2-devel@lists.sourceforge.net"> \
libssh2-devel@lists.sourceforge.net</a><br>> <a \
href="https://lists.sourceforge.net/lists/listinfo/libssh2-devel" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/libssh2-devel</a><br>> \
<br><br>------------------------------------------------------------------------- \
<br>Check out the new SourceForge.net Marketplace.<br>It's the best place to buy \
or sell services for<br>just about anything Open Source.<br><a \
href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace" \
target="_blank"> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</a><br>_______________________________________________<br>libssh2-devel \
mailing list<br><a href="mailto:libssh2-devel@lists.sourceforge.net">libssh2-devel@lists.sourceforge.net
</a><br><a href="https://lists.sourceforge.net/lists/listinfo/libssh2-devel" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/libssh2-devel</a><br></div></div></blockquote></div><br><br \
clear="all"><br>-- <br> 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic