function FindProxyForURL(url, host) { //------------------------Customer Section------------------------ //Add your internal domains within quotations marks like "wwwin.acme.com" //after the right parenthesis below. Please remove the two examples //below and add your own internal domains. var dont_proxy_customer_list = ["10.10.10.0","*.10.10.10.0","asfdasdas","*.asfdasdas","demo.com","*.demo.com","test.com","*.test.com","testest.com","*.testest.com","testNoApplies.com","*.testNoApplies.com","*.accompany.com","*.ciscospark.com","*.digicert.com","*.eum-appdynamics.com","*.quovadisglobal.com","*.walkme.com","*.wbx2.com","*.webex.com","mail01.cloud.corp","*.mail01.cloud.corp","onion.com","*.onion.com","painelcybersec.dcbr01.corp","*.painelcybersec.dcbr01.corp","portaltelecom.dcbr01.corp","*.portaltelecom.dcbr01.corp","testing.com","*.testing.com","wfs.gsb","*.wfs.gsb","*.it.menlosecurity.com"]; //Warning to Administrators: Touching any section after this point might //affect your users browsing experience and lead to considerable number //of issues and loading your customer support. //---------------------End Customer Section----------------------- for(var iter = 0; iter < dont_proxy_customer_list.length; ++iter) { if(shExpMatch(host, dont_proxy_customer_list[iter])) { return "DIRECT"; } } var dont_proxy_infra = new Array( "ocsp.int-x3.letsencrypt.org", "isrg.trustid.ocsp.identrust.com", "*.cisco.com", "*.opendns.com", "*.umbrella.com", "*.okta.com", "*.oktacdn.com", "*.oktapreview.com", "*.pingidentity.com", "*.microsoftonline-p.com", "*.ultipro.com", "*.ultiproworkplace.com", "*.ultimatesoftware.com", "*.ultipro.ca", "*.ultiprotime.com", "*.ultiprorecruit.com", "*.ultipro-time-management.com" ); for(var iter = 0; iter < dont_proxy_infra.length; ++iter) { if( shExpMatch(host, dont_proxy_infra[iter]) && !shExpMatch(host, "*gateway.id.swg.umbrella.com") && !shExpMatch(host, "policy-debug.opendns.com") && !shExpMatch(host, "block.opendns.com") ) { return "DIRECT"; } } // if the incoming costumer port in different from 443 | 80 // assumption: url is valid. // urlWithPortRegEx: // starts with any char // contains ':' and at least 1 digits after. // ends with '' | '/' | '/...' var urlWithPortRegEx = /(.+):(\d+)($|([\/](.*))+)/; var urlPort80RegEx = /(.+):80($|([\/](.*))+)/; var urlPort443RegEx = /(.+):443($|([\/](.*))+)/; if (urlWithPortRegEx.test(url) && !urlPort80RegEx.test(url) && !urlPort443RegEx.test(url)) { return "DIRECT"; } // If host name is local (i.e. contains no dots), connect directly. if (isPlainHostName(host)) { return "DIRECT"; } var privateIP = /^(0|10|127|192.168|172.1[6789]|172.2[0-9]|172.3[01]|169.254|192.88.99).[0-9.]+$/; if (privateIP.test(host)) { return "DIRECT"; } var protocolIndex = url.indexOf("://"); var protocol = url.substring(0, protocolIndex); switch (protocol) { case "https": case "wss": return "PROXY 146.112.255.148:443"; case "http": case "ws": return "PROXY 146.112.255.148:80"; default: return "DIRECT"; } }