Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

closed as off-topic by Tom O'Connor Aug 10 '13 at 1:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Even if not native, please let me know a program that can do it instead –  Net Citizen Jan 10 '10 at 1:59
    
There's this really sweet program called Linux that would fix this in a heartbeat. ;) –  EEAA Jan 10 '10 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 '10 at 9:44
add comment

7 Answers

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

share|improve this answer
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? –  Net Citizen Jan 10 '10 at 2:00
add comment

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

share|improve this answer
    
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. –  Net Citizen Jan 10 '10 at 13:24
add comment

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.

share|improve this answer
    
I need to do this in a transparent way –  Net Citizen Jan 10 '10 at 13:24
add comment

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/

share|improve this answer
add comment

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/

share|improve this answer
    
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 '13 at 13:02
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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