Easy TCP proxy on Windows?

Solution 1:

You can use the built-in netsh portproxy. In your case:

netsh interface portproxy add v4tov4 listenport=80 connectaddress=ip-of-server-on-internet connectport=23 listenaddress=ip-of-windows-machine protocol=tcp

You'll need Administrator privileges. No need to install additional software!

You are required to install IPv6 on your operating system before using this feature. On Vista and later this is a non-issue as IPv6 comes installed by default, but on XP/2003 you have to open up your network interface property panel, and add the Microsoft TCP/IP version 6 protocol first.

Solution 2:

Note: Luca's answer which arrived three years after this one was accepted, is probably the one that you want if running Vista or later.

rinetd should do the job, and a Windows binary for it can be had from [sorry, link no longer valid] (for anyone looking for the same thing under Linux, rinetd is in the standard repositories of just about every distro so can be installed with "apt-get install rinetd" or "yum install rinetd" or similar)

Note: the previous link to a Windows binary is no longer valid. Windows builds of the tool can be found in cygwin and similar packages, after a cursory search I didn't find a direct link to a stand-alone Windows binary to replace the link with. All references found pointed to the same, now invalid, link.

Solution 3:

You're looking for a TCP proxy. There are a variety of free TCP proxies for Windows. I'm not going to recommend one because I don't have any good experience with any of them. Google for "Windows TCP proxy" and you'll come up with a boatload.

This one is cute and source is available, but I don't know how reliable: http://dposey.no-ip.com/Proxy/

It's a fairly trivial piece of code, though one could put some pretty neat features into a high-end TCP proxy (load balancing, logging of traffic, etc).

Solution 4:

Assuming it's http packets you could use one of the many windows proxies out there Like Squid NT or something similar.

But if you just wanna port forward any packets, SSH tunneling is the way to go. Check out sshwindows for the server piece and http://oldsite.precedence.co.uk/nc/putty.html for a quick howto on how to set up port forwarding in PuTTY.

There might be an easier way using Some built in Microsoft tool, but this is what came to the top of my head first.