Skip to content

Instantly share code, notes, and snippets.

@buchi
Created September 22, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buchi/22778db9b9076612fd1a8b5ec720beae to your computer and use it in GitHub Desktop.
Save buchi/22778db9b9076612fd1a8b5ec720beae to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
// Adressen, die auf example.com liegen, brauchen keinen Proxy:
if (shExpMatch(host,"*.example.com")) {
return "DIRECT";
}
// URLs innerhalb dieses Netzwerkes werden abgefragt über
// Port 8080 auf fastproxy.example.com: (macht Nameserver Anfrage)
if (isInNet(host, "10.0.0.0", "255.255.248.0")) {
return "PROXY fastproxy.example.com:8080";
}
// Alle anderen Anfragen gehen über Port 8000 von proxy.example.com.
// sollte das fehlschlagen, verbinde direkt ins Netz:
return "PROXY proxy.example.com:8000; DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment