Last active
December 3, 2019 14:12
-
-
Save ylxdzsw/9bf9211a4560ee0cfee1e1a9e3ec91bb to your computer and use it in GitHub Desktop.
my pac file
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
| // ylxdzsw's minimalistic pac | |
| const [DIRECT, PROXY] = "__DIRECT__" == "__DIR" + "ECT__" // __xx__ will be replaced when used within some softwares | |
| ? ["DIRECT", "SOCKS5 localhost:1080"] | |
| : ["__DIRECT__", "__PROXY__"] | |
| const list = [ | |
| // frequent | |
| /google/, | |
| "github.com", | |
| "githubassets.com", | |
| "wikipedia.org", | |
| // social | |
| "facebook.com", | |
| "fbcdn.net", | |
| "fbsbx.com", | |
| "instagram.com", | |
| "messenger.com", | |
| "steamcommunity.com", | |
| "telegram.me", | |
| "telegram.org", | |
| "t.me", | |
| "twitter.com", | |
| "tumblr.com", | |
| "reddit.com", | |
| "medium.com", | |
| "quora.com", | |
| // news | |
| "bloombergview.com", | |
| "bbc.com", | |
| "bbc.co.uk", | |
| "bbcchinese.com", | |
| "ftchinese.com", | |
| // media | |
| "netflix.com", | |
| "spotify.com", | |
| "hbo.com", | |
| "pixiv.net", | |
| "youtube.com", | |
| // tech | |
| "android.com", | |
| "appspot.com", | |
| "blogspot.com", | |
| "chrome.com", | |
| "chromium.org", | |
| "tensorflow.org", | |
| "v2ex.com", | |
| "python.com", | |
| "mozilla.org", | |
| "redis.io", | |
| "rust-lang.org", | |
| "docker.com", | |
| // airport | |
| /cccat/", | |
| /cordcloud/, | |
| "v2ray.com", | |
| // coin & blockchain & p2p | |
| "bitfinex.com", | |
| "okex.com", | |
| "huobi.com", | |
| "zb.com", | |
| "localbitcoins.com", | |
| "ipfs.io", | |
| // cdn & cloud service | |
| "amazonaws.com", | |
| "githubusercontent.com", | |
| "dropbox.com", | |
| "dropboxusercontent.com", | |
| "onedrive.live.com", | |
| "pastebin.com", | |
| "jsfiddle.net", | |
| "ytimg.com", | |
| "tyimg.com", | |
| "ggpht.com", | |
| "1drv.com", | |
| "redd.it", | |
| // misc | |
| "1.1.1.1", | |
| "recaptcha.net", | |
| "gstatic.com", | |
| "openweathermap.org", | |
| "primera.e-sim.org" | |
| ] | |
| function FindProxyForURL(url, host) { | |
| return isPlainHostName(host) ? DIRECT : | |
| list.some(x => x instanceof RegExp ? x.test(host) : host.endsWith(x)) ? PROXY : DIRECT | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment