Internet: Automaticly distribute proxy settings for IE and Firefox

With the following procedure which make’s use of dns settings and a apache webserver it is possible to automaticly distribute the squid (or any other proxy server) proxy configuration :

1. Use your favorite additor to create a proxy.pac file and wpad.dat file

- the typical proxy.pac file will look like this :

function FindProxyForURL(url, host) {
if (isInNet(host, “192.168.1.0”, “255.255.255.0”))
{
return “DIRECT”;
}
else if (isInNet(host, “172.16.1.0”, “255.255.255.0”))
{
return “DIRECT”;
}
else if (isInNet(host,”127.0.0.1”,”255.255.255.255”))
else
{
return “PROXY proxy.isp:8080;SOCKS proxy.isp:30000”;
}
}

2. Create symlink for proxy.pac #ln -s proxy.pac wpad.dat

3. Add the mimetype for pac and dat files in Apache application/x-ns-proxy-autoconfig pac dat

4. Make sure the wpad entry is added to your domain pointing to the webserver

You can find additional information on the following websites :

http://nscsysop.hypermart.net/proxypac.html http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html http://linux.cudeso.be/linuxdoc/squid.php http://proxy.nsysu.edu.tw/FAQ/FAQ-5.html

Posted by Administrator on Wednesday, November 22, 2006

digg delicious technorati blinklist furl reddit