Skip to content

Instantly share code, notes, and snippets.

@seungjin
Last active August 29, 2015 14:08
Show Gist options
  • Save seungjin/7fa5c6c25306efcc426e to your computer and use it in GitHub Desktop.
Save seungjin/7fa5c6c25306efcc426e to your computer and use it in GitHub Desktop.
my gfwlist.js
// Made this for my China stay
// My collection of domains
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var domains = {
"blogspot.com": 1,
"googleusercontent.com": 1,
"blogger.com": 1,
"blogspot.kr": 1,
"farwestchina.com": 1,
"phinf.naver.net": 1,
"mobilytrip.com": 1,
"akamaihd.net": 1,
"phpschool.com": 1,
"wikitree.co.kr": 1,
"wordpress.com": 1,
"blog.naver.com": 1,
"bit.ly": 1,
"bbc.co.uk": 1,
"radioplayer.co.uk": 1,
"t.co": 1,
"snsanalytics.com": 1,
"cdninstagram.com": 1,
"ggpht.com": 1,
"gmail.com": 1,
"box.net": 1,
"box.com": 1,
"goo.gl": 1,
"youtube.com": 1,
"google.com": 1,
"facebook.com": 1,
"thefacebook.com": 1,
"gstatic.com": 1,
"twitter.com": 1,
"nytimes.com": 1,
"nytimes.com.": 1,
"dropbox.com": 1,
"instagram.com": 1,
"twimg.com": 1,
"cnn.com": 1,
"bbc.co.uk": 1,
"imrworldwide.com": 1,
"bbci.co.uk": 1,
"ml314.com": 1,
"nyt.com": 1,
"googleapis.com": 1,
"kyobobook.co.kr": 1,
"epost.go.kr": 1,
"bittorrent.com": 1,
"slack-redir.com": 1,
"tvcast.naver.com": 1,
"rmcnmv.naver.com": 1,
"gist.github.com": 1,
"it.co.kr": 1,
"danawa.com": 1,
"ytimg.com": 1,
"googlevideo.com": 1,
"vimeo.com": 1,
"brightcove.com": 1,
"newrelic.com": 1,
"dynamicyield.com": 1,
"chartbeat.net": 1,
"googlesyndication.com": 1,
"effectivemeasure.net": 1,
"scorecardresearch.com": 1,
"typekit.net": 1,
"s3.amazonaws.com": 1,
"foursquare.com": 1,
};
var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;";
var direct = 'DIRECT;';
var hasOwnProperty = Object.hasOwnProperty;
function FindProxyForURL(url, host) {
var suffix;
var pos = host.lastIndexOf('.');
pos = host.lastIndexOf('.', pos - 1);
while(1) {
if (pos <= 0) {
if (hasOwnProperty.call(domains, host)) {
return proxy;
} else {
return direct;
}
}
suffix = host.substring(pos + 1);
if (hasOwnProperty.call(domains, suffix)) {
return proxy;
}
pos = host.lastIndexOf('.', pos - 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment