Skip to content

Instantly share code, notes, and snippets.

@pontus
Created June 14, 2018 06:54
Show Gist options
  • Save pontus/b43e796778e6fb1abdf1cbafdd78ecd6 to your computer and use it in GitHub Desktop.
Save pontus/b43e796778e6fb1abdf1cbafdd78ecd6 to your computer and use it in GitHub Desktop.
PAC (Proxy autoconfiguration) usage
function FindProxyForURL(url, host) {
// only list domains we want proxy for, connect from our machine for everything else.
if (dnsDomainIs(host,"uppmax.uu.se"))
{
return "SOCKS5 127.0.0.1:1081";
}
if (dnsDomainIs(host,"csc.fi"))
{
return "SOCKS5 127.0.0.1:1081";
}
if (dnsDomainIs(host, "epouta.csc.fi"))
{
return "SOCKS5 127.0.0.1:1082";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment