编写自动路由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";
}

发表于 2019.12.19 17:50:24

前篇:目录名做为文件名前缀python脚本

后篇:Kafka