Last active
October 25, 2017 07:57
-
-
Save lsongdev/8142c43a5096730c0a745f5507dcee44 to your computer and use it in GitHub Desktop.
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
| // Powered by proxy.lsong.org | |
| var proxy = [ | |
| { type: 'SOCKS5', proxy: 'gateway.lsong.org:1080' }, | |
| { type: 'SOCKS' , proxy: 'gateway.lsong.org:1080' }, | |
| 'DIRECT' | |
| ].map(function(p){ | |
| if(typeof p === 'string') return p; | |
| return [ p.type, p.proxy ].join(' '); | |
| }).join('; '); | |
| var rules = [ | |
| // github | |
| "github.com", | |
| "github.io", | |
| "githubusercontent.com", | |
| // npmjs.org | |
| "npmjs.com", | |
| "en25.com", | |
| "cdn.optimizely.com", | |
| "twitter.com", | |
| "api.twitter.com", | |
| "twimg.com", | |
| "facebook.com", | |
| "facebook.net", | |
| "fb.com", | |
| "fb.me", | |
| "fbcdn.net", | |
| "fbsbx.com", | |
| // facebook messager | |
| "m.me", | |
| "messenger.com", | |
| "instagram.com", | |
| "goo.gl", | |
| "google.com", | |
| "google.com.hk", | |
| // youtube | |
| "youtu.be", | |
| "youtube.com", | |
| "yt.be", | |
| "ytimg.com", | |
| // telegram | |
| "t.me", | |
| "telegram.me", | |
| "telegram.org", | |
| ".telegramdownload.com", | |
| // stackoverflow | |
| "stackoverflow.com" | |
| ]; | |
| function FindProxyForURL(url, host) { | |
| for(var i in rules){ | |
| var rule = rules[i]; | |
| if(~url.indexOf(rule)) return proxy; | |
| } | |
| return 'DIRECT'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment