| 1 |
// Go direct for plain hostnames and any host in .manugarg.com domain except |
| 2 |
// for www and www.manugarg.com. |
| 3 |
// Go via proxy for all other hosts. |
| 4 |
|
| 5 |
function FindProxyForURL(url, host) { |
| 6 |
if ( |
| 7 |
(isPlainHostName(host) || dnsDomainIs(host, '.manugarg.com')) && |
| 8 |
!localHostOrDomainIs(host, 'www.manugarg.com') |
| 9 |
) |
| 10 |
return 'plainhost/.manugarg.com'; |
| 11 |
|
| 12 |
// Test single quote handling in URL. |
| 13 |
if (/'/.test(url)) { |
| 14 |
return 'URLHasQuotes'; |
| 15 |
} |
| 16 |
|
| 17 |
// Return externaldomain if host matches .*\.externaldomain\.com |
| 18 |
if (/.*\.externaldomain\.com/.test(host)) return 'externaldomain'; |
| 19 |
|
| 20 |
// Test if DNS resolving is working as intended |
| 21 |
if (dnsDomainIs(host, '.google.com') && isResolvable(host)) |
| 22 |
return 'isResolvable'; |
| 23 |
|
| 24 |
// Test if DNS resolving is working as intended |
| 25 |
if (dnsDomainIs(host, '.notresolvabledomainXXX.com') && !isResolvable(host)) |
| 26 |
return 'isNotResolvable'; |
| 27 |
|
| 28 |
if (/^https:\/\/.*$/.test(url)) return 'secureUrl'; |
| 29 |
|
| 30 |
if (isInNet(myIpAddress(), '10.10.0.0', '255.255.0.0')) return '10.10.0.0'; |
| 31 |
|
| 32 |
if ( |
| 33 |
typeof myIpAddressEx == 'function' && |
| 34 |
isInNetEx(myIpAddressEx(), '3ffe:8311:ffff/48') |
| 35 |
) |
| 36 |
return '3ffe:8311:ffff'; |
| 37 |
else return 'END-OF-SCRIPT'; |
| 38 |
} |