Skip to content

Instantly share code, notes, and snippets.

@Arcath
Created March 26, 2012 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arcath/2205071 to your computer and use it in GitHub Desktop.
Save Arcath/2205071 to your computer and use it in GitHub Desktop.
Proxy.pac for a school
function FindProxyForURL(url, host){
/* The IP Range in the form 10.X.X (miss off digit 4) */
iprange = "10.0.0";
/* The Subnet */
subnet = "255.255.255.0";
/* The Domain Name */
localdomain = "school.local";
/* Default proxy to the school proxy, then lea proxy */
proxy = "PROXY proxy.school.local; PROXY proxy.lea.local:8080; DIRECT";
if (isInNet(host, "127.0.0.0", "255.0.0.0") ||
isInNet(host, iprange + ".0", subnet) ||
dnsDomainIs(host, localdomain) ||
isPlainHostName(host)){
/* Set the Proxy server to DIRECT */
proxy = "DIRECT";
}
return proxy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment