Sunday, November 20, 2011

Web browser’s default auto detect proxy server feature chooses proxy server I don’t want to use.

There are a couple reasons you might want to use wpad.dat that I know of.
1) you want to use a proxy server for certain websites, but not for others.
2) you don’t want to use a proxy server, you want to go directly out the internet and bypass, but machines auto detect one.
3) a mixture of the above.
The cure is wpad.dat, if you can control DHCP options, then this is a great choice.  Add the following options to your scope options.
option wpad-url code 252 = text;
option wpad-url “”;
The wpad.dat example file below basically says, go directly to a website, unless it is in, then use a specified proxy
Contents of wpad.dat file below:

function FindProxyForURL(url, host)
   if (isPlainHostName(host))
    return "DIRECT";
   else if (shExpMatch(host, "*"))
    return "PROXY";
   else if (shExpMatch(host, "*"))
    return "DIRECT";

No comments: