Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Is there any way to connect two sockets together?

by jeroenes (Priest)
on Jan 11, 2001 at 20:42 UTC ( [id://51150]=note: print w/replies, xml ) Need Help??


in reply to Is there any way to connect two sockets together?

Why don't you just use SSH for that?
ssh localhost -f -S -L $localport:$proxy:$proxyport
and it does exactly what your script is trying to do. But I'm still confused if that is what you want to do, as I see little use for it.

Cheers,

Jeroen
I was dreaming of guitarnotes that would irritate an executive kind of guy (FZ)

Update: The -S option of SSH makes sure it doesn't try to connect, only functions as portmapper. Moreover, I forgot the supply 'localhost', and the -f option is handy as well.

Replies are listed 'Best First'.
Re: Re: Is there any way to connect two sockets together?
by zigster (Hermit) on Jan 11, 2001 at 20:46 UTC
    Because my script is a cut down of the big picture. In the big picture it tunnels over a http proxy. It opens up a socket connection with a remote internet host via the proxy (using the connect method) this is a trival negotiation1. It then connects the data recieved from that connection to a local port. I can then connect applications to the local port and so to the outside world.

    1 CONNECT host:port HTTP1/0 <NL> or some such.
    --

    Zigster

      Aha.

      Than use the SSH solution I gave you should work. It just tunnels a local connection to $localport to $proxy:$proxyport. You simply let your client connect to $localport and it wouldn't know the difference.

      Hope this helps,

      Jeroen
      I was dreaming of guitarnotes that would irritate an executive kind of guy (FZ)

        That will not work, OK without going too far down this road what will you connect the ssh proxy port too? The proxy? It is a web proxy why not connect directly to that.. The point is that the proxy talks http I need to setup the conduit before I can use it ssh does not know how to do it.. Damn this would be easier if I had paper, does that make more sense?
        --

        Zigster

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://51150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-16 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found