Archive

Posts Tagged ‘Wpad file for Multiple Networks’

Wpad file for Multiple Networks

January 25th, 2010 Dhaval Thakar No comments

WPAD.DAT

Many of us use this proxy configuration file to automate proxy configuration for users.

It is easy to configure wpad.dat for single network, but for some reason if you wish to use same wpad.dat file for multiple networks following might help you.


function FindProxyForURL(url, host)
{
if (shExpMatch(url, "http://localhost*")) { return "DIRECT"; }
if (shExpMatch(url, "https://127.0.0.1*")) { return "DIRECT"; }
if (shExpMatch(url, "https://192.168.2*")) { return "DIRECT"; }
//this is for networks
if (isInNet(myIpAddress(), "192.168.10.0", "255.255.255.0"))
return "PROXY 192.168.10.20:3128";
else
return "PROXY 192.168.2.20:3128";
}
Google Buzz