Skip to content

Instantly share code, notes, and snippets.

@mybeky
Created September 25, 2012 13:55
Show Gist options
  • Save mybeky/3782065 to your computer and use it in GitHub Desktop.
Save mybeky/3782065 to your computer and use it in GitHub Desktop.
Bypass proxy for local networks
function FindProxyForURL(url, host)
{
var resolved_ip = dnsResolve(host);
if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") ||
isInNet(resolved_ip, "172.16.0.0", "255.240.0.0") ||
isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
return "DIRECT";
return "PROXY YOUR_PROXY_IP:PORT; DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment