// ******************************************************************** // template.txt: Version 5.0 // // Proxy Auto-Config (PAC) template file for web browser and roaming // users. Follow the instruction through this configuration file to // update for your specific environment. // // Notes: // - "host" refers to the host portion of the URL being requested (i.e. // everything after the :// at the beginning of the URL up to the // first colon (:) or slash (/) (e.g. www.example.com). // - "url" refers to the entire URL being requested. This includes // the protocol and file (e.g. http://www.example.com/index.html). // - Microsoft IE processes the PAC file once per hostname and caches // the result. You cannot have different behaviour for the same // hostname (e.g. http://www.example.com/index.html must be // directed to the same proxy as http://www.example.com/foo.html). // - isInNet will perform a DNS lookup for non IP addresses. Ensure the // host is a raw IP before using this function. // - For debugging, set the debug variable to true. // ******************************************************************** function FindProxyForURL(url, host) { var debug = false; var direct = "DIRECT"; // Proxy addresses by region. var proxy1_eu = "PROXY proxy1.eu.webscanningservice.com:3128"; var proxy1_us = "PROXY proxy1.us.webscanningservice.com:3128"; var proxy2_us = "PROXY proxy2.us.webscanningservice.com:3128"; var proxy1_ap = "PROXY proxy1.ap.webscanningservice.com:3128"; var proxy1_hk = "PROXY proxy1.hk.webscanningservice.com:3128"; var proxy1_jp = "PROXY proxy1.jp.webscanningservice.com:3128"; var proxy1_de = "PROXY proxy1.de.webscanningservice.com:3128"; var proxy1_nl = "PROXY proxy1.nl.webscanningservice.com:3128"; // ***************************************************************** // Proxy address for roaming users, specify the appropriate region // ***************************************************************** var roaming1_eu = "PROXY roaming1.eu.webscanningservice.com:80"; var roaming1_us = "PROXY roaming1.us.webscanningservice.com:80"; var roaming2_us = "PROXY roaming2.us.webscanningservice.com:80"; var roaming1_ap = "PROXY roaming1.ap.webscanningservice.com:80"; var roaming1_hk = "PROXY roaming1.hk.webscanningservice.com:80"; var roaming1_jp = "PROXY roaming1.jp.webscanningservice.com:80"; var roaming1_de = "PROXY roaming1.de.webscanningservice.com:80"; var roaming1_nl = "PROXY roaming1.nl.webscanningservice.com:80"; var roaming = roaming1_eu; // ***************************************************************** // Specify your CSP address if applicable, one line for each // distinct company subnet. // ***************************************************************** // var proxy_csp_1 = "PROXY :3128"; // var proxy_csp_2 = "PROXY :3128"; // ***************************************************************** // Failover open to Roaming // ***************************************************************** // var proxy_csp_1_failing_open = proxy_csp_1 + “;” + roaming; // var proxy_csp_2_failing_open = proxy_csp_2 + “;” + roaming; // Source IP address. var myIp = myIpAddress(); // If the host is this computer, connect directly if ((host == "localhost") || (host == "localhost.localdomain") || (host == "127.0.0.1")) { if (debug) alert("PAC: DIRECT: localhost: " + host); return direct; } // If host name is local (i.e. contains no dots), connect directly. if (isPlainHostName(host)) { if (debug) alert("PAC: DIRECT: plain host: " + host); return direct; } // If host name is part of the IANA private IP address ranges, connect // directly. if (/^\d+\.\d+\.\d+\.\d+$/.test(host) && (isInNet(host, "10.0.0.0", "255.0.0.0") || isInNet(host, "172.16.0.0", "255.240.0.0") || isInNet(host, "192.168.0.0", "255.255.0.0"))) { if (debug) alert("PAC: DIRECT: IANA private network: " + host); return direct; } // ***************************************************************** // Specify remote URLs that are trusted and don't require proxying // and should be bypassed when roaming. // ***************************************************************** if (shExpMatch(host, "*.download.microsoft.com") || shExpMatch(host, "*.windowsupdate.com") || shExpMatch(host, "*.windowsupdate.microsoft.com") || shExpMatch(host, "windowsupdate.microsoft.com") || shExpMatch(host, "*.update.microsoft.com") || shExpMatch(host, "update.microsoft.com")) { if (debug) alert("PAC: BYPASS: Windows Update: " + host); roaming = direct; } // ***************************************************************** // Specify VPN ranges, one line for each VPN range. // When using a VPN, proxying is done through roaming proxy. // ***************************************************************** // if (isInNet(myIp, "", "" )) { if(debug) alert("PAC: ROAMING: VPN1: " + host); return roaming; } // if (isInNet(myIp, "", "" )) { if(debug) alert("PAC: ROAMING: VPN1: " + host); return roaming; } // ***************************************************************** // Specify local FQDNs which do not require proxying, one line per // expression. Shell expression patterns can be used. // ***************************************************************** // if (shExpMatch(host, "")) { if(debug) alert("PAC: ROAMING: Local FQDN 1: " + host); return direct; } // if (shExpMatch(host, "")) { if(debug) alert("PAC: ROAMING: Local FQDN 1: " + host); return direct; } // ***************************************************************** // Specify company subnet source IP address ranges which require // proxying, one line per expression. Specify adequate proxy region // or CSP address for each range. // ***************************************************************** // if (isInNet(myIp, "", "")) { if(debug) alert("PAC: ROAMING: Subnet 1: " + host); return ; } // if (isInNet(myIp, "", "")) { if(debug) alert("PAC: ROAMING: Subnet 2: " + host); return ; } // When outside company subnet, connect to roaming proxy. if (debug && roaming != direct) alert("PAC: ROAMING: Default: " + host); return roaming; }