1

Assuming my Windows (xp, vista, 2003, 2008, or windows 7) computer is connected directly to the internet and has no router in between...

Is there a way to filter all traffic going TO port 80, so that it instead goes to 3128 (squid HTTP proxy)?

I found this port mapping software, but you need another computer because it can't redirect outgoing requests.

3
  • Even if not native, please let me know a program that can do it instead Jan 10, 2010 at 1:59
  • There's this really sweet program called Linux that would fix this in a heartbeat. ;)
    – EEAA
    Jan 10, 2010 at 2:05
  • 1
    In this network arrangement, where does the proxy server live? Is the Windows machine the web server or client? BTW, there is always a router between you and the "Internet". Just as Soilent Green is made of people, the Internet is made of routers.
    – pcapademic
    Jan 10, 2010 at 9:44

7 Answers 7

1

I don't believe this can be done natively in windows. Why don't you just set Squid to listen on port 80?

1
  • 1
    Because I want to transparently router all web page traffic through squid. I don't think setting squid to listen on port 80 has anything to do that. Am I maybe missing something in the understanding of squid? Jan 10, 2010 at 2:00
1

The product you are looking for is NetCat and does exactly what you need. Check the Wikipedia page. The specific command line you want is

nc -l -p 80 | nc localhost 3128

1
  • This allows me to receive any traffic on port 80 (incoming). What I need to do is redirect any outgoing traffic on port to go to 127.0.0.1 3128. Jan 10, 2010 at 13:24
1

This article from Microsoft ( http://support.microsoft.com/kb/819961 ) discusses configuring a proxyserver for the system. For other browsers, such as firefox, you may need to configure the proxy settings independently.

1
  • I need to do this in a transparent way Jan 10, 2010 at 13:24
1

I recognize this doesn't answer your question, but you should really put a real firewall/router appliance in place to do this: I would recommend either pfSense or Smoothwall.

If it has to be a Windows box for whatever reason, your best bet is ISA Server - though typically it handles in-bound routing better so this may not even be possible. As far as I know, Microsoft has not exposed the IP stack in such a way you can add custom routes/translations without writing a custom driver to sit in the network stack.

Excellent ISA resource: http://www.isaserver.org/

1

The shareware PC Port Forwarding is all there is for redirecting outgoing traffic with an easy to use GUI under Windows. Obtain it from http://www.verigio.com/products/pc-port-forwarding/

1
  • Welcome to Server Fault! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Scott Pack
    Jul 6, 2013 at 13:02
0

You can do what you're looking for with SoftPerfect Bandwidth Manager and Squid on a single server.

If you can't handle the cost of SoftPerfect Bandwidth Manager you'd probably do well to get any one of the "canned" Linux distributions that come with Squid pre-installed and just use that.

0

If you are using Linux, the best way to do this would be iptables.

Make sure ip_forward is on

echo 1 >/proc/sys/net/ipv4/ip_forward

Replace IP_ADDRESS with your destination IP address

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination IP_ADDRESS

iptables -t nat -A POSTROUTING -p tcp -d IP_ADDRESS --dport 80 -j MASQUERADE

I use it regularly to redirect all traffic from one server to another server, usually after a server migration into another datacenter.

Not the answer you're looking for? Browse other questions tagged or ask your own question.