northeast_technician Posted November 12, 2015 Posted November 12, 2015 could someone help me write a pac file for proxy settings? i need two, one for staff and one for pupils. thanks in advance
Duke5A Posted November 19, 2015 Posted November 19, 2015 function FindProxyForURL(url, host) { //Declare proxy strings as variables var studentproxy = "PROXY MrSquid.domain.com:3128"; // IP not to use proxy if (shExpMatch(url, "http://10.*")) { return "DIRECT"; } if (shExpMatch(url, "http://127.0.0.1*")) { return "DIRECT"; } if (isPlainHostName(host)) { return "DIRECT"; } // URLS not to use proxy server if (shExpMatch(url, "*schoolhomepage.com*")) { return "DIRECT"; } if (shExpMatch(url, "*someotherservice.net*")) { return "DIRECT"; } // Apply proxy if machine is on internal network if (isInNet(myIpAddress(), "10.0.0.0", "255.0.0.0")) { return studentproxy; } if (isInNet(myIpAddress(), "10.0.0.0", "/8")) { return studentproxy; } else return "DIRECT"; } The two lines under the 'apply proxy' section was a fix I had to do because Internet Explorer and Firefox read subnets differently, or something like that. It was a long time ago and it still works. I forget who I got the above from, but it was from a member here. 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