Proxy Servers and Internet Explorer Scripts

Solar

Well-Known Member
Joined
Sep 13, 2003
Messages
112
Reaction score
0
Location
South Africa.
Those of you who are lucky enough to use a local proxy server to get international access when you are capped, might appreciate the following piece of info:

Having to switch MANUALLY between proxy and non-proxy for international and local traffic respectively isn't fun. Use the following script:

function FindProxyForURL(url, host)
{
if ( isInNet(host, "146.232.0.0" , "255.255.0.0"))
{ return "PROXY 192.168.0.2:3128"; }
else if ( isInNet(host, "196.0.0.0" , "255.0.0.0"))
{ return "PROXY 192.168.0.2:3128"; }
else if ( isInNet(host, "165.0.0.0" , "255.0.0.0"))
{ return "PROXY 192.168.0.2:3128"; }
else if ( isInNet(host, "168.210.0.0" , "255.255.0.0"))
{ return "PROXY 192.168.0.2:3128"; }

else
return "DIRECT";
}

So basically, what you do is,
1) save this file as PROXY.PAC on your drive somewhere.
2) Replace 192.168.0.2 with your own proxy server
3) Right click on Internet Explorer, go to PROPERTIES > CONNECTIONS > LAN SETTINGS > click USE AUTOMATIC CONFIGURATION SCRIPT
4) And enter the path to the PROXY.PAC file in the box, typically:
c:\proxy.pac

This doesn't work for ALL south african addresses, because there are some exceptions to the addresses I assumed, but it isn't noticable for normal browsing and downloading.

Try it, and let me know.

-Solar
 
Oh, sorry: It seems to me like the newer versions of Internet Explorer can only accept proxy scripts from an HTTP server, in other words, you will have to put your PROXY.PAC file on an http server somewhere.
The easiest way to do that (if you don't have access to a webserver), is to install microsoft's PERSONAL WEB SERVER (PWS) and put proxy.pac in the serving directory.

Then, enter "http://127.0.0.1/PROXY.PAC" into internet explorer's AUTO CONFIGURATION SCRIPT box. (Without the quotes).
 
The script I posted does EXACTLY the opposite of what I meant it to do in this instance, the correct one should be (if you want local traffic to go DIRECT, and international traffic through a proxy server:

function FindProxyForURL(url, host)
{
if ( isInNet(host, "146.232.0.0" , "255.255.0.0"))
{ return "DIRECT"; }
else if ( isInNet(host, "196.0.0.0" , "255.0.0.0"))
{ return "DIRECT"; }
else if ( isInNet(host, "165.0.0.0" , "255.0.0.0"))
{ return "DIRECT"; }
else if ( isInNet(host, "168.210.0.0" , "255.255.0.0"))
{ return "DIRECT"; }

else
return "PROXY 192.168.0.2:3128";
}

Where 192.168.0.2 is your proxy server, and 3128 is the port on which it operates.
 
Top
Sign up to the MyBroadband newsletter
X