const localnets = [ ['192.168.0.0', '255.255.0.0'], ['172.16.0.0', '255.240.0.0'], ['10.0.0.0', '255.0.0.0'], ['127.0.0.0', '255.0.0.0'], ]; const sockyhosts = [ "*.onion", "*.xnxx.com", "pornhub.com", "*.pornhub.com", ]; function FindProxyForURL(url, host) { if (isPlainHostName(host)) { return "DIRECT"; } for (var indy in localnets) { if (isInNet(dnsResolve(host), localnets[indy][0], localnets[indy][1])) { return "DIRECT"; } } for (var k = 0; k < sockyhosts.length; k++) { if (shExpMatch(host, sockyhosts[k]) || shExpMatch(url, sockyhosts[k])) { return "SOCKS 192.168.42.82:9050; DIRECT"; } } return "DIRECT; SOCKS 192.168.42.82:9050"; }