function FindProxyForURL(url, host) { / Normalize the URL for pattern matching url = url.toLowerCase(); host = host.toLowerCase(); /* Don't proxy local hostnames */ if (isPlainHostName(host)) { return 'DIRECT'; } // If the hostname matches, send direct. if (dnsDomainIs(host, "(*.4lpi.pvt|4lpi.pvt)") || shExpMatch(host, "(*.4lpi.pvt|4lpi.pvt|*.4lpi.com|4lpi.com)")) return "DIRECT"; // If the requested website is hosted within the internal network, send direct. var hostIP = dnsResolve(host); if (isPlainHostName(host) || shExpMatch(host, "(*.local|*.pvt)") || isInNet(hostIP, '10.0.0.0', '255.0.0.0') || isInNet(hostIP, '127.0.0.0', '255.0.0.0') || isInNet(hostIP, '169.254.0.0', '255.255.0.0') || isInNet(hostIP, '172.16.0.0', '255.240.0.0') || isInNet(hostIP, '192.0.2.0', '255.255.255.0') || isInNet(hostIP, '192.88.99.0', '255.255.255.0') || isInNet(hostIP, '192.168.0.0', '255.255.0.0') || isInNet(hostIP, '198.18.0.0', '255.254.0.0') || isInNet(hostIP, '224.0.0.0', '240.0.0.0') || isInNet(hostIP, '240.0.0.0', '240.0.0.0')) return "DIRECT"; if (shExpMatch(host, "(litle.com|*.litle.com)") || shExpMatch(host, "(vantiv.com|*.vantiv.com)")) return "PROXY 192.168.100.80:3128"; // if (isInNet(myIpAddress(), "10.252.0.0", "255.255.0.0")) return "DIRECT" if (isInNet(myIpAddress(), "192.168.2.0", "255.255.255.0")) return "PROXY 192.168.102.4:3128; PROXY 192.168.100.80:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.8.0", "255.255.255.0")) return "PROXY 192.168.102.4:3128; PROXY 192.168.100.80:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.16.0", "255.255.255.0")) return "PROXY 192.168.16.2:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.32.0", "255.255.255.0")) return "PROXY 192.168.32.2:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.48.0", "255.255.252.0")) return "DIRECT" if (isInNet(myIpAddress(), "192.168.64.0", "255.255.255.0")) return "DIRECT" if (isInNet(myIpAddress(), "192.168.72.0", "255.255.255.0")) return "DIRECT" if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0")) return "PROXY 192.168.100.80:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.101.0", "255.255.255.0")) return "PROXY 192.168.101.80:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.102.0", "255.255.255.0")) return "PROXY 192.168.102.4:3128; PROXY 192.168.100.80:3128; DIRECT" if (isInNet(myIpAddress(), "192.168.103.0", "255.255.255.0")) return "PROXY 192.168.102.4:3128; PROXY 192.168.100.80:3128; DIRECT" // if (shExpMatch(host, "(kaspersky.com|*.kaspersky.com)")) return "DIRECT"; // if (shExpMatch(host, "(microsoft.com|*.microsoft.com)")) return "DIRECT"; // if (shExpMatch(host, "(windowsupdate.com|*.windowsupdate.com)")) return "DIRECT"; if (url.substring(0, 6) == "https:") return "DIRECT"; if (url.substring(0, 6) == "ftp:") return "DIRECT"; // DEFAULT RULE: All other traffic, return DIRECT return "DIRECT"; }