Using Proxy.pac File To Automatically Configure Browsers for Proxy
As someone who uses a notebook PC between work and home I have constantly needed to switch off and on my internet proxy settings.
I finally got sick of doing this and discovered that with a special file called proxy.pac I can automatically detect whether to use a proxy or not.
The file is a special Javascript routine such as this...
function FindProxyForURL(url, host)
{
// variable strings to return
var proxy_yes = "PROXY ieproxy2:8081";
var proxy_no = "DIRECT";
if (shExpMatch(url, "http://www.mycompanywebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.myotherwebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.my3rdlocalsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://10.200.*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "10.200.0.0", "255.255.0.0"))
return proxy_yes;
else
return proxy_no;
}