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'; } /* Send authentication direct */ if ( dnsDomainIs(host, ".ignasiak.com") || dnsDomainIs(host, ".menloadmin.com") || dnsDomainIs(host, "safe.surfcrew.com") ) { return 'DIRECT'; } /* All other menlosecurity traffic goes through proxy */ if ( dnsDomainIs(host, "surfcrew.com") ) { return 'PROXY proxy-36.surfcrew.com:3129; DIRECT'; } if (isResolvable(host)) { var hostIP = dnsResolve(host); /* Don't proxy non-routable addresses (RFC 3330) */ if (isInNet(hostIP, '0.0.0.0', '255.0.0.0') || 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 ( url.substring(0, 5) == 'http:' ) { return 'PROXY proxy-36.surfcrew.com:3129'; } if ( url.substring(0, 6) == 'https:' ) { return 'PROXY proxy-36.surfcrew.com:3129'; } return 'DIRECT'; }