Skip to content

Instantly share code, notes, and snippets.

@sadanand-singh
Created July 5, 2023 10:26
Show Gist options
  • Save sadanand-singh/8e51a99f5c31198a71a7db4354eb96d6 to your computer and use it in GitHub Desktop.
Save sadanand-singh/8e51a99f5c31198a71a7db4354eb96d6 to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
// URLs within this network are accessed through
// port 8080 on fastproxy.example.com:
if (isInNet(host, "10.20.3.205", "255.255.0.0")) {
return "SOCKS 127.0.0.1:50001";
}
if (isInNet(host, "192.168.150.3", "255.255.0.0")) {
return "SOCKS 127.0.0.1:50001";
}
// All other requests go through port 8080 of proxy.example.com.
// should that fail to respond, go directly to the WWW:
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment