紫藤花开的日子
发布时间:2021-06-06
发布时间:2021-06-06
function FindProxyForURL(url, host){
if(isPlainHostName(host)) return 'DIRECT';
if(!shExpMatch(url, 'http*')) return 'DIRECT';
var ip = dnsResolve(host);
// no dns result
if(!ip) return 'PROXY 127.0.0.1:8083;';
// ipv6
if(shExpMatch(ip, '*:*')) return 'DIRECT';
// local
else if(isInNet(ip,'127.0.0.0','255.0.0.0')) return 'DIRECT';
else if(isInNet(ip,'10.0.0.0','255.0.0.0')) return 'DIRECT';
else if(isInNet(ip,'192.168.0.0','255.255.0.0')) return 'DIRECT';
else if(isInNet(ip,'172.16.0.0','255.240.0.0')) return 'DIRECT';
else if(isInNet(ip,'169.254.0.0','255.255.0.0')) return 'DIRECT';
// video rules
else if(shExpMatch(url, '*.flv')) return 'PROXY ' + host + ':8081;';
else if(shExpMatch(url, '*.mp4')) return 'PROXY ' + host + ':8081;';
else if(shExpMatch(url, 'http:*/flv/*.flv?*&key=*')) return 'PROXY ' + host + ':8081;';
else if(shExpMatch(url, 'http:*/mp4/*.f4v?*&key=*')) return 'PROXY ' + host + ':8081;';
else if(shExpMatch(url, '*.flv?start=*')) return 'PROXY ' + host + ':8081;';
else if(shExpMatch(url, '*.mp4?start=*')) return 'PROXY ' + host + ':8081;';
else if (isInNet(ip, '58.154.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '58.192.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '58.194.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '58.196.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '58.198.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '58.200.0.0','255.248.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.64.0.0','255.252.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.68.0.0','255.252.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.72.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.74.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.76.0.0','255.255.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.77.0.0','255.255.0.0')) return 'DIRECT';
else if (isInNet(ip, '59.78.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '110.64.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '111.114.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '111.116.0.0','255.254.0.0')) return 'DIRECT';
else if (isInNet(ip, '111.186.0.0','255.254.0.0')) return 'DIRECT';