function FindProxyForURL(url, host) { // ========================================================= // Section 1: Standard PAC values var privateIP = /^(0|10|127|192\.168|172\.1[6789]|172\.2[0-9]|172\.3[01]|169\.254|192\.88\.99)\.[0-9.]+$/; var resolved_ip = dnsResolve(host); /* Don't send non-FQDN or private IP auths to us */ if (isPlainHostName(host) || isInNet(resolved_ip, "192.0.2.0", "255.255.255.0") || privateIP.test(resolved_ip)) return "DIRECT"; /* FTP goes directly */ if (url.substring(0, 4) == "ftp:") return "DIRECT"; //Portquiz DIRECT if (shExpMatch(host, "portquiz.net")) { return "DIRECT"; } // ========================================================= // Section 2: Define Variables // Get NIC IP address nicIp = myIpAddress(); // Assigning values to "tonetskope" and "bypassproxy" if (isInNet(nicIp, "0.0.0.0", "0.0.0.1")) { var tonetskope = "PROXY csc1vip:80; PROXY csc2vip:80"; var bypassproxy = "PROXY csc1bypass:3128; PROXY csc2bypass:3128"; } if (isInNet(nicIp, "0.0.0.1", "0.0.0.1")) { var tonetskope = "PROXY csc2vip:80; PROXY csc1vip:80"; var bypassproxy = "PROXY csc2bypass:3128; PROXY csc1bypass:3128"; } // ========================================================= // Section 3: Bypass via Cloud Security Connectors // Bypass via CSC Public IPs (Examples) if ( // Okta Domains (for Location Rules) (shExpMatch(host, "*.okta.com")) || (shExpMatch(host, "*.oktacdn.com")) || (shExpMatch(host, "*.okta-emea.com")) || // Other Domains and Subdomains (shExpMatch(host, "login.mydomain.com")) || (shExpMatch(host, "*.mydomain2.com")) || // O365 Domains for ConditionalAccess (shExpMatch(host, "login.microsoftonline.com")) || (shExpMatch(host, "login.microsoft.com")) || (shExpMatch(host, "login.windows.net")) || // IP Test Page (shExpMatch(host, "ip.maidenheadbridge.com")) ) { return bypassproxy } // End Section 3 // ========================================================= // Section 4: Default Traffic // Default Traffic Forwarding. return tonetskope }