TCP Portforwarding

Jason Creighton androflux at REMOVETOREPLYsofthome.net
Sat May 17 13:34:45 EDT 2003


On Sat, 17 May 2003 17:26:34 +0200
Thomas Guettler <guettli at thomas-guettler.de> wrote:

> 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.

It's easy. Search freshmeat for "tcp port forward". If you're using UNIX, you
could even use inetd and netcat to forward the port. Whatever OS you're using
probably has DNAT (Destination NAT), so that's another option. There's no need
to write this in Python, unless, of course, you want to learn more about
Python's TCP features.

Jason Creighton




More information about the Python-list mailing list