Skip to content

Instantly share code, notes, and snippets.

@zolunx10
Created March 27, 2013 06:21
Show Gist options
  • Save zolunx10/5252132 to your computer and use it in GitHub Desktop.
Save zolunx10/5252132 to your computer and use it in GitHub Desktop.
messy configure files
function FindProxyForURL(url, host) {
// ZJU
if (
dnsDomainIs(host, ".zju.edu.cn")
|| isInNet(host, "10.0.0.0", "255.0.0.0")
|| isInNet(host, "210.32.0.0", "255.255.240.0")
|| isInNet(host, "210.32.128.0", "255.255.192.0")
) {
return "DIRECT";
}
// Predefined rules, You could modify them by yourself.
if (
shExpMatch(url, "*://*.google.com/*")
|| shExpMatch(url, "*://*.google.com.*/*")
|| shExpMatch(url, "*://*.google-analytics.com/*")
|| shExpMatch(url, "*://*.googleapis.com/*")
|| shExpMatch(url, "*://*.googlecode.com/*")
|| shExpMatch(url, "*://*.googleusercontent.com/*")
|| shExpMatch(url, "*://*.gstatic.com/*")
|| shExpMatch(url, "*://*.wikipedia.org/*")
|| shExpMatch(url, "*://*.twimg.com/*")
|| shExpMatch(url, "*://*.ytimg.com/*")
|| shExpMatch(url, "*://t.co/*")
|| shExpMatch(url, "*://bit.ly/*")
|| shExpMatch(url, "*://goo.gl/*")
|| shExpMatch(url, "*://fb.me/*")
|| shExpMatch(url, "*://wp.me/*")
|| shExpMatch(url, "*://j.mp/*")
|| shExpMatch(url, "*://ow.ly/*")
|| shExpMatch(url, "*://po.st/*")
|| shExpMatch(url, "*://bbc.in/*")
)
{
return 'PROXY 127.0.0.1:8087';
}
return FindProxyForURLByAutoProxy(url, host);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment