Guest User

Proxy Config

a guest
Dec 25th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. /* Modify but do not remove the following 3 lines */
  2. /* 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 */
  3. var swgdomain = "[REDACTED]"
  4.  
  5.  
  6. var domain = "[REDACTED]"
  7. var swgpublicip = "[REDACTED]"
  8.  
  9. /* MOST PEOPLE WILL NOT NEED TO EDIT BELOW THIS LINE: */
  10.  
  11. /* EAM 20170822, don't change the template without consulting [REDACTED] */
  12. function FindProxyForURL(url,host) {
  13.  
  14. hostIP = dnsResolve(host)
  15. swgpublicip = dnsResolve(swgdomain)
  16.  
  17. /* Bypass the proxy for local resources: */
  18.  
  19. if (isPlainHostName(host) ||
  20. shExpMatch(host, "*.local") ||
  21. isInNet(hostIP, "10.0.0.0", "255.0.0.0") ||
  22. isInNet(hostIP, "172.16.0.0", "255.240.0.0") ||
  23. isInNet(hostIP, "192.168.0.0", "255.255.0.0") ||
  24. isInNet(hostIP, "169.254.0.0", "255.255.0.0") ||
  25. isInNet(hostIP, "224.0.0.0", "240.0.0.0") ||
  26. isInNet(hostIP, "240.0.0.0", "240.0.0.0") ||
  27. isInNet(hostIP, "0.0.0.0", "255.0.0.0") ||
  28. isInNet(hostIP, "127.0.0.0", "255.0.0.0")
  29. ) {return "DIRECT"; }
  30.  
  31. /* These domains are for your equipment specifically: */
  32.  
  33. else if (shExpMatch(host, "*" + domain) ||
  34. (host == swgpublicip) ||
  35. (hostIP == swgpublicip)
  36. ) { return "DIRECT"; }
  37.  
  38. /* These are for Google SSO: */
  39.  
  40. else if (shExpMatch(host, "*gstatic.com") ||
  41. shExpMatch(host, "accounts.google.com")
  42. ) { return "DIRECT"; }
  43.  
  44. /* These are for Apple devices (such as iPads): */
  45.  
  46. else if (shExpMatch(host, "*appleiphonecell.com") ||
  47. shExpMatch(host, "*thinkdifferent.us") ||
  48. shExpMatch(host, "*airport.us") ||
  49. shExpMatch(host, "*ibook.info") ||
  50. shExpMatch(host, "captive.apple.com") ||
  51. shExpMatch(url, "http://gsp1.apple.com/pep/gcc") ||
  52. shExpMatch(host, "*itools.info") ||
  53. shExpMatch(url, "http://www.apple.com/library/test/success.html") ||
  54. shExpMatch(host, "*guzzoni.apple.com") )
  55. { return "DIRECT"; }
  56.  
  57. /* This section is for Microsoft: */
  58.  
  59. else if (shExpMatch(host, "*download.microsoft.com") ||
  60. shExpMatch(host, "*ntservicepack.microsoft.com") ||
  61. shExpMatch(host, "*windowsupdate.microsoft.com") ||
  62. shExpMatch(host, "*update.microsoft.com") ||
  63. shExpMatch(host, "*cdm.microsoft.com") ||
  64. shExpMatch(host, "*wustat.windows.com") ||
  65. shExpMatch(host, "*windowsupdate.com") ||
  66. shExpMatch(host, "*windowsupdate.microsoft.com") )
  67. { return "DIRECT"; }
  68.  
  69. /* Captive portals (hotels and such) and local preferences: */
  70.  
  71. else if (shExpMatch(host, "*wayport.net") )
  72. { return "DIRECT"; }
  73.  
  74. /* This is for iboss servers */
  75.  
  76. else if (shExpMatch(host, "*.iboss.com") ||
  77. shExpMatch(host, "*.ibosscloud.com") ||
  78. isInNet(hostIP, "208.70.72.0", "255.255.248.0") ||
  79. isInNet(hostIP, "206.125.41.128", "255.255.255.192") )
  80. { return "DIRECT"; }
  81.  
  82. /* The final proxy statement: */
  83.  
  84. else if (dnsResolve("myiboss.net") == "208.70.74.18")
  85. { return "PROXY " + swgpublicip + ":8009"; }
  86.  
  87. /* If on network, go direct (no proxy): */
  88.  
  89. else { return "DIRECT"; }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment