
0

编写自动路由pac文件
source link: https://qidizi.github.io/%E7%BC%96%E5%86%99-%E8%87%AA%E5%8A%A8-%E8%B7%AF%E7%94%B1-pac-%E6%96%87%E4%BB%B6/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
编写自动路由pac文件
var ad = '*.zhyonk.cn,*.9suz8.cn,*.cnzz.com,push.zhanzhang.baidu.com,*.imoohome.com'.split(',');
var block = 'PROXY 127.0.0.1:1';
function FindProxyForURL(url, host) {
// lan pass
if (isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") ||
isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") ||
isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0")
)
return "DIRECT";
for(var i = 0;i < ad.length;i++)
if (shExpMatch(host, ad[i]))
return block;
// pass
return "DIRECT";
}
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK