Last active
August 22, 2017 09:41
-
-
Save ryerh/5e25ec17774c24e41b9ae061016d95db to your computer and use it in GitHub Desktop.
Proxy PAC
This file contains 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
const PROXY = 'SOCKS5 localhost:1080; DIRECT'; | |
const NO_PROXY = 'DIRECT'; | |
const WHITE_LIST = [ | |
/126.net/, | |
/163.com/, | |
/360buying.com/, | |
/alicdn.com/, | |
/aliyun.com/, | |
/baidu.com/, | |
/bdimg.com/, | |
/bdstatic.com/, | |
/bootcdn.com/, | |
/bootcss.com/, | |
/daocloud.io/, | |
/dict.cn/, | |
/douban.com/, | |
/doubanio.com/, | |
/fastapi.net/, | |
/henghost.com/, | |
/jd.com/, | |
/processon.com/, | |
/qingcloud.com/, | |
/qq.com/, | |
/ryerh.com/, | |
/taobao.com/, | |
/weibo.com/, | |
/xsky.com/, | |
/ydstatic.com/, | |
/youdao.com/, | |
/zhihu.com/, | |
/zhimg.com/, | |
// local | |
/^(10|127|192).*/, | |
/^localhost/, | |
]; | |
function FindProxyForURL(url, host) { | |
return WHITE_LIST.some(i => i.test(host)) ? NO_PROXY : PROXY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment