TCP Portforwarding

Chris Liechti cliechti at gmx.net
Sat May 17 18:38:35 EDT 2003


Thomas Guettler <guettli at thomas-guettler.de> wrote in 
news:mailman.1053185306.7810.python-list at python.org:

> Hi!
> 
> I want to forward a tcp port to a remote machine:
> 
>  localhost:2000 --> remote:80
> 
> All requests to localhost:2000 should be forwarded to remote:80. I
> thought that this would be easy, but it is more difficult as I
> thought.

i've implemented this in this script:
http://homepage.hispeed.ch/py430/python/directforwarder.py

its a bit bigger, because i stripped it down from an other tool that i used 
to make connections though a proxy.

> I think this should be possible with less than 100 lines. Or am I
> wrong?

mine is a bit larger, but if you remove some of the unneeded features maybe 
;-)

and i'm sure its that short with twisted...

chris

-- 
Chris <cliechti at gmx.net>





More information about the Python-list mailing list