Skip to content

Instantly share code, notes, and snippets.

@robertoandrade
Created April 27, 2022 13:57
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 robertoandrade/93828c7505c17fe66436238fa0436948 to your computer and use it in GitHub Desktop.
Save robertoandrade/93828c7505c17fe66436238fa0436948 to your computer and use it in GitHub Desktop.
PAC config for returning SOCKS proxy for local network addresses
function FindProxyForURL(url, host) {
// our local URLs from the domains below example.com don't need a proxy:
if (shExpMatch(host, "*.example.com"))
{
return "DIRECT";
}
// URLs within this network are accessed through
// port 8888 on localhost:
if (isInNet(host, "192.168.10.0", "255.255.255.0"))
{
return "SOCKS5 localhost:8888;SOCKS localhost:8888";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment