Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Modify but do not remove the following 3 lines */
- /* For Cloud, the swgdomain should be the cloud host (ncxxx-cncxxxx.ibosscloud.com), the swgpublicIP should be your home network NAT IP address, and the domain should be your domain or your custom login page domain */
- var swgdomain = "[REDACTED]"
- var domain = "[REDACTED]"
- var swgpublicip = "[REDACTED]"
- /* MOST PEOPLE WILL NOT NEED TO EDIT BELOW THIS LINE: */
- /* EAM 20170822, don't change the template without consulting [REDACTED] */
- function FindProxyForURL(url,host) {
- hostIP = dnsResolve(host)
- swgpublicip = dnsResolve(swgdomain)
- /* Bypass the proxy for local resources: */
- if (isPlainHostName(host) ||
- shExpMatch(host, "*.local") ||
- isInNet(hostIP, "10.0.0.0", "255.0.0.0") ||
- isInNet(hostIP, "172.16.0.0", "255.240.0.0") ||
- isInNet(hostIP, "192.168.0.0", "255.255.0.0") ||
- isInNet(hostIP, "169.254.0.0", "255.255.0.0") ||
- isInNet(hostIP, "224.0.0.0", "240.0.0.0") ||
- isInNet(hostIP, "240.0.0.0", "240.0.0.0") ||
- isInNet(hostIP, "0.0.0.0", "255.0.0.0") ||
- isInNet(hostIP, "127.0.0.0", "255.0.0.0")
- ) {return "DIRECT"; }
- /* These domains are for your equipment specifically: */
- else if (shExpMatch(host, "*" + domain) ||
- (host == swgpublicip) ||
- (hostIP == swgpublicip)
- ) { return "DIRECT"; }
- /* These are for Google SSO: */
- else if (shExpMatch(host, "*gstatic.com") ||
- shExpMatch(host, "accounts.google.com")
- ) { return "DIRECT"; }
- /* These are for Apple devices (such as iPads): */
- else if (shExpMatch(host, "*appleiphonecell.com") ||
- shExpMatch(host, "*thinkdifferent.us") ||
- shExpMatch(host, "*airport.us") ||
- shExpMatch(host, "*ibook.info") ||
- shExpMatch(host, "captive.apple.com") ||
- shExpMatch(url, "http://gsp1.apple.com/pep/gcc") ||
- shExpMatch(host, "*itools.info") ||
- shExpMatch(url, "http://www.apple.com/library/test/success.html") ||
- shExpMatch(host, "*guzzoni.apple.com") )
- { return "DIRECT"; }
- /* This section is for Microsoft: */
- else if (shExpMatch(host, "*download.microsoft.com") ||
- shExpMatch(host, "*ntservicepack.microsoft.com") ||
- shExpMatch(host, "*windowsupdate.microsoft.com") ||
- shExpMatch(host, "*update.microsoft.com") ||
- shExpMatch(host, "*cdm.microsoft.com") ||
- shExpMatch(host, "*wustat.windows.com") ||
- shExpMatch(host, "*windowsupdate.com") ||
- shExpMatch(host, "*windowsupdate.microsoft.com") )
- { return "DIRECT"; }
- /* Captive portals (hotels and such) and local preferences: */
- else if (shExpMatch(host, "*wayport.net") )
- { return "DIRECT"; }
- /* This is for iboss servers */
- else if (shExpMatch(host, "*.iboss.com") ||
- shExpMatch(host, "*.ibosscloud.com") ||
- isInNet(hostIP, "208.70.72.0", "255.255.248.0") ||
- isInNet(hostIP, "206.125.41.128", "255.255.255.192") )
- { return "DIRECT"; }
- /* The final proxy statement: */
- else if (dnsResolve("myiboss.net") == "208.70.74.18")
- { return "PROXY " + swgpublicip + ":8009"; }
- /* If on network, go direct (no proxy): */
- else { return "DIRECT"; }
- }
Advertisement
Add Comment
Please, Sign In to add comment