Skip to content

Instantly share code, notes, and snippets.

@dhval
Last active August 27, 2024 17:17
Show Gist options
  • Save dhval/3bf6f2e97a43760fee7e840f28e970d2 to your computer and use it in GitHub Desktop.
Save dhval/3bf6f2e97a43760fee7e840f28e970d2 to your computer and use it in GitHub Desktop.
myproxy.pac
function FindProxyForURL(url, host) {
PROXY = "SOCKS5 127.0.0.1:9743; SOCKS 127.0.0.1:9743"
// PROXY = "PROXY 127.0.0.1:9743"
// "PROXY 127.0.0.1:23870";
alert("ABCXY request for (" + url+ " with host: " + host + ")");
if(shExpMatch(url, "http://10.182.70.240*"))
return PROXY;
}
// Apple.com via proxy
if (shExpMatch(host,"*.pa.gov") || shExpMatch(host, "172.*")
|| shExpMatch(host, "*10.182.*")
|| shExpMatch(host, ".*gov.*")
) {
alert(host + " passed!");
return PROXY;
}
// Everything else directly!
alert(host + " bnot passed!");
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment