Created
July 16, 2011 18:32
-
-
Save moluapple/1086621 to your computer and use it in GitHub Desktop.
proxy.pac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
// If URL has no dots in host name, send traffic direct. | |
if (isPlainHostName(host)) | |
return "DIRECT"; | |
// If specific URL needs to bypass proxy, send traffic direct. | |
if (shExpMatch(url,"activate.adobe.com") || | |
shExpMatch(url,"*dropbox.com") || | |
shExpMatch(url,"*alcohol-soft.com") || | |
shExpMatch(url,"*registeridm.com") || | |
shExpMatch(url,"*qiyi.com*")) | |
return "DIRECT"; | |
// If IP address is internal or hostname resolves to internal IP, send direct. | |
var resolved_ip = dnsResolve(host); | |
if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") || | |
isInNet(resolved_ip, "172.16.0.0", "255.240.0.0") || | |
isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") || | |
isInNet(resolved_ip, "127.0.0.0", "255.255.255.0")) | |
return "DIRECT"; | |
// All other traffic uses below proxies, in fail-over order. | |
return "PROXY 127.0.0.1:8087; DIRECT"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment