Skip to content

Instantly share code, notes, and snippets.

@neilxp
Created July 17, 2012 06:24
Show Gist options
  • Save neilxp/3127577 to your computer and use it in GitHub Desktop.
Save neilxp/3127577 to your computer and use it in GitHub Desktop.
proxy.pac
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
url = url.toLowerCase();
host = host.toLowerCase();
var proxy = "PROXY 1.1.1.1:8999";
if (shExpMatch(url, '*.265g.com*')) return proxy;
if (shExpMatch(url, '*.facebook.com*')) return proxy;
if (shExpMatch(url, '*.facebook.net*')) return proxy;
if (shExpMatch(url, '*.fbcdn.net*')) return proxy;
if (shExpMatch(url, '*.gmail.com*')) return proxy;
if (shExpMatch(url, '*.google.com*')) return proxy;
if (shExpMatch(url, '*.googleusercontent.com*')) return proxy;
if (shExpMatch(url, '*.gstatic.com*')) return proxy;
if (shExpMatch(url, '*twitter.com/*')) return proxy;
if (shExpMatch(url, '*twimg.com/*')) return proxy;
if (shExpMatch(url, '*youtube.com*')) return proxy;
if (shExpMatch(url, '*.ytimg.com*')) return proxy;
if (shExpMatch(url, '*soundofhope.org*')) return proxy;
if (shExpMatch(url, '*img.ly/*')) return proxy;
if (shExpMatch(url, '*bit.ly/*')) return proxy;
if (shExpMatch(url, '*t.co/*')) return proxy;
if (shExpMatch(url, '*ntdtv.com/*')) return proxy;
if (shExpMatch(url, '*.blogspot.com/*')) return proxy;
if (shExpMatch(url, '*.blogspot.com.*/*')) return proxy;
if (shExpMatch(url, '*.rfi.fr/*')) return proxy;
if (shExpMatch(url, '*.cloudfront.net/*')) return proxy;
if (shExpMatch(url, '*zlib.net/*')) return proxy;
if (shExpMatch(url, '*.doxygen.org/*')) return proxy;
if (shExpMatch(url, '*epochtimes.com/*')) return proxy;
if (shExpMatch(url, '*.westca.com/*')) return proxy;
if (shExpMatch(url, '*.creaders.net/*')) return proxy;
if (shExpMatch(url, 'j.mp/*')) return proxy;
if (shExpMatch(url, '*.hudson-ci.org/*')) return proxy;
if (shExpMatch(url, '*.amazonaws.com/*')) return proxy;
if (shExpMatch(url, '*.googlecode.com/*')) return proxy;
if (shExpMatch(url, '*.mongodb.org/*')) return proxy;
if (shExpMatch(url, '*.tudou.com/*')) return proxy;
if (shExpMatch(url, '*blip.tv/*')) return proxy;
if (shExpMatch(url, '*minus.com/*')) return proxy;
if (shExpMatch(url, '*dropbox.com/*')) return proxy;
if (shExpMatch(url, '*.alexa.com/*')) return proxy;
if (shExpMatch(url, '*.chromium.org/*')) return proxy;
if (shExpMatch(url, '*.cloudfront.net/*')) return proxy;
if (shExpMatch(url, '*.appcelerator.com/*')) return proxy;
if (shExpMatch(url, '*.appcelerator.org/*')) return proxy;
if (shExpMatch(url, '*vimeo.com/*')) return proxy;
if (shExpMatch(url, '*.mktorep.com/*')) return proxy;
if (shExpMatch(url, '*mobile-patterns.com/*')) return proxy;
if (shExpMatch(url, '*pttrns.com/*')) return proxy;
if (shExpMatch(url, '*.dnspod.cn/*')) return proxy;
if (shExpMatch(url, '*.mongodb.org/*')) return proxy;
if (shExpMatch(url, '*.frederico-araujo.com/*')) return proxy;
if (shExpMatch(url, '*git-scm.com/*')) return proxy;
if (shExpMatch(url, '*jenkins-ci.org/*')) return proxy;
if (shExpMatch(url, '*instagr.am/*')) return proxy;
if (shExpMatch(url, '*websocket.org/*')) return proxy;
if (shExpMatch(url, '*do.com/*')) return proxy;
if (shExpMatch(url, '*learnboost.com/*')) return proxy;
if (shExpMatch(url, '*clickdummy.net/*')) return proxy;
if (shExpMatch(url, '*launchrock.com/*')) return proxy;
if (shExpMatch(url, '*diigo.com/*')) return proxy;
if (shExpMatch(url, '*wordpress.org/*')) return proxy;
if (shExpMatch(url, '*wordpress.com/*')) return proxy;
if (shExpMatch(url, '*.wp.com/*')) return proxy;
if (shExpMatch(url, '*icloud.com/*')) return proxy;
if (shExpMatch(url, '*shortmail.com/*')) return proxy;
if (shExpMatch(url, '*appspot.com/*')) return proxy;
if (shExpMatch(url, '*.zend.com/*')) return proxy;
if (shExpMatch(url, '*.tumblr.com/*')) return proxy;
if (shExpMatch(url, '*apigee.com/*')) return proxy;
if (shExpMatch(url, '*viddler.com/*')) return proxy;
if (shExpMatch(url, '*.scribd.com/*')) return proxy;
if (shExpMatch(url, '*.netdna-cdn.com/*')) return proxy;
if (shExpMatch(url, '*.phonegap.com/*')) return proxy;
if (shExpMatch(url, '*.ggpht.com/*')) return proxy;
if (shExpMatch(url, '*cocoacontrols.com/*')) return proxy;
if (shExpMatch(url, '*.mashable.com/*')) return proxy;
if (shExpMatch(url, '*picture.io/*')) return proxy;
if (shExpMatch(url, '*zeptojs.com/*')) return proxy;
if (shExpMatch(url, '*.aculo.us/*')) return proxy;
if (shExpMatch(url, '*.qunhe.cc/*')) return proxy;
if (shExpMatch(url, '*.splashtop.com/*')) return proxy;
if (shExpMatch(url, '*asana.com/*')) return proxy;
if (shExpMatch(url, '*.sun.com/*')) return proxy;
if (shExpMatch(url, '*.cprogramming.com/*')) return proxy;
if (shExpMatch(url, '*.microsoft.com/*')) return proxy;
if (shExpMatch(url, '*getpocket.com/*')) return proxy;
if (shExpMatch(url, '*skitch.com/*')) return proxy;
if (shExpMatch(url, '*.mysql.com/*')) return proxy;
if (shExpMatch(url, '*.evernote.com/*')) return proxy;
if (shExpMatch(url, '*.idv.tw/*')) return proxy;
if (shExpMatch(url, 'developer.apple.com/*')) return proxy;
if (shExpMatch(url, 'cocovoice.com/*')) return proxy;
if (shExpMatch(url, '*.vimeocdn.com/*')) return proxy;
if (shExpMatch(url, '*.webappsolution.com/*')) return proxy;
if (shExpMatch(url, '*.in-appstore.com/*')) return proxy;
//if (shExpMatch(url, '*.tbcdn.cn/*')) return proxy;
return 'DIRECT';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment