Skip to content

Instantly share code, notes, and snippets.

@victor141516
Last active August 26, 2025 14:37
Show Gist options
  • Save victor141516/8ab01a71b71133b61fb88c292038814c to your computer and use it in GitHub Desktop.
Save victor141516/8ab01a71b71133b61fb88c292038814c to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
// Bypass localhost and local network addresses
if (
shExpMatch(host, "localhost") ||
shExpMatch(host, "*.local") ||
isInNet(host, "127.0.0.0", "255.0.0.0") ||
isInNet(host, "10.0.0.0", "255.0.0.0") ||
isInNet(host, "172.16.0.0", "255.240.0.0") ||
isInNet(host, "192.168.0.0", "255.255.0.0")
) {
return "DIRECT";
}
// Bypass specific domains
if (
dnsDomainIs(host, "zpa-mock.foroartificial.com") ||
dnsDomainIs(host, ".okta.com") ||
shExpMatch(host, "*.okta.com")
) {
return "DIRECT";
}
// Send everything else to the proxy
return "PROXY cbi-dev-fra5-1.cbi-zia-mock.isolation.appsulate.com:8443";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment