function FindProxyForURL(url, host) { // Normalize the URL and host for pattern matching url = url.toLowerCase(); host = host.toLowerCase(); // Bypass the proxy for local hostnames if (isPlainHostName(host)) { return "DIRECT"; } // Bypass the proxy for specific domains var domains = ["www.google.com", "maps.google.com", "docs.google.com", ".kppsoft.com", ".ir", "*.thewebstage.com"]; for (var i = 0; i < domains.length; i++) { if (dnsDomainIs(host, domains[i])) { return "DIRECT"; } } // Use HTTPS proxy for HTTPS URLs if (url.substring(0, 4) == "http") { return "HTTPS dl.thewebstage.com:3333"; } if (url.substring(0, 6) == "wss://") { return "HTTPS dl.thewebstage.com:3333"; } // Use HTTP proxy for everything else return "DIRECT"; }