FN-GM Posted September 22, 2010 Author Posted September 22, 2010 I think you need the .pac file to run on a webserver. I installed IIS on our proxy and used that. Thanks
steve Posted September 22, 2010 Posted September 22, 2010 Give this a go: function FindProxyForURL(url, host) { // Execptions for direct connection if (shExpMatch(url, "*google.com*") shExpMatch(url, "*example2.com*")) return "DIRECT"; // Proxy if PC is on local LAN if (isInNet(myIpAddress(), "172.16.96.0", "255.255.252.0")) return "PROXY 172.16.96.52:8080"; else if (isInNet(myIpAddress(), "172.16.16.0", "255.255.252.0")) return "PROXY 172.16.16.30:8080"; // Everything else to go direct else return "DIRECT"; }
DarrenShan Posted September 23, 2010 Posted September 23, 2010 FN-GM I have not tried it on a webserver as I want to put the PAC file locally onto some laptops - it's supposed to work as a local file. Steve - Thanks for your script but it didn't work even on Firefox or Opera (after changing the IP to suit) - but if I put my original code back into the PAC file it works in Firefox and Opera - it's just IE8 that I'm having a problem with. Note: I understand that IE caches some of this information so between tests I'm running CCleaner.
Iain Posted September 23, 2010 Posted September 23, 2010 How are you specifying the location of the .pac file in IE8? Your script works for me if I give the address of the file as file:// See attached screenshot FN-GM I have not tried it on a webserver as I want to put the PAC file locally onto some laptops - it's supposed to work as a local file. Steve - Thanks for your script but it didn't work even on Firefox or Opera (after changing the IP to suit) - but if I put my original code back into the PAC file it works in Firefox and Opera - it's just IE8 that I'm having a problem with. Note: I understand that IE caches some of this information so between tests I'm running CCleaner.
box_l Posted September 23, 2010 Posted September 23, 2010 (edited) Hi, I have wanted to use a .pac file for all the schools we support, the thing is, we have inherited a set of schools with 192.168. address sets. This is what everyone seems to have at home too so basing the pac on isInNet(myIpAddress() is a bit of a non-starter. Is there any way I can use some other part of the DCHP provided config? Like the DNS server address or default gateway maybe? TIA BoX Edited September 23, 2010 by box_l spelling
CyberNerd Posted September 23, 2010 Posted September 23, 2010 Hi, I have wanted to use a .pac file for all the schools we support, the thing is, we have inherited a set of schools with 192.168. address sets. This is what everyone seems to have at home too so basing the pac on isInNet(myIpAddress() is a bit of a non-starter. Is there any way I can use some other part of the DCHP provided config? Like the DNS server address or default gateway maybe? TIA BoX rename (or link) the proxy.pac file to wpad.dat then make a dns entry for "wpad" with the ip address of the webserver. set the browser to 'autodiscovery' at which point it will look for http://wpad/wpad.dat - if it fails it should go direct, otherwise will use the proxy.pac file settings. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now