Last active
January 31, 2021 23:36
-
-
Save OnkelDom/39cdabbbbbcece754f47c09b86ff6300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exmaple Pac-File | |
function FindProxyForURL(url, host) | |
{ | |
//set variables | |
var client = myIpAddress(); | |
var direct = "DIRECT"; | |
var proxy = "PROXY proxy.home.onkeldom.eu:3128"; | |
var proxy-internal = "PROXY proxy.home.onkeldom.eu:3130"; | |
// proxy while Split-Brain - special way for onkeldom.eu | |
if (shExpMatch(host, "onkeldom.eu")) { return proxy; } | |
// proxy specific domain to proxy-internal | |
if (shExpMatch(host, "unifi.home.onkeldom.eu")) { return proxy-internal; } | |
// no proxy for internal networks | |
if (isPlainHostName(host)) { return direct; } | |
if (shExpMatch(host, "localhost")) { return direct; } | |
if (shExpMatch(host, "*.local")) { return direct; } | |
if (isInNet(host, "127.0.0.1", "255.0.0.0")) { return direct; } | |
if (isInNet(host, "169.254.0.0", "255.255.0.0")) { return direct; } | |
if (isInNet(host, "172.16.0.0", "255.240.0.0")) { return direct; } | |
if (isInNet(host, "192.168.0.0", "255.255.0.0")) { return direct; } | |
if (isInNet(host, "10.0.0.0", "255.0.0.0")) { return direct; } | |
if (isInNet(host, "0.0.0.0", "255.0.0.0")) { return direct; } | |
if (shExpMatch(host, "fe80:*")) { return direct; } | |
if (shExpMatch(host, "fc00:*")) { return direct; } | |
if (shExpMatch(host, "::1")) { return direct; } | |
// no proxy for internal domains | |
if (shExpMatch(host, "home.onkeldom.eu")) { return direct; } | |
if (shExpMatch(host, "*.home.onkeldom.eu")) { return direct; } | |
if (shExpMatch(host, "*.infra.onkeldom.eu")) { return direct; } | |
// return proxy for any not defined acls | |
return proxy; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment