Skip to content

Instantly share code, notes, and snippets.

@walbinjr
Last active November 6, 2017 17:40
Show Gist options
  • Save walbinjr/4597988b4d21911e1dce9ffbb39744d4 to your computer and use it in GitHub Desktop.
Save walbinjr/4597988b4d21911e1dce9ffbb39744d4 to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
var proxy = "PROXY walbinjr.ddns.net:8118; DIRECT";
var direct = "DIRECT";
// no proxy for local hosts without domain:
if(isPlainHostName(host)) return direct;
//We only cache http
if (
url.substring(0, 4) == "ftp:" ||
url.substring(0, 6) == "rsync:"
)
return direct;
// proxy everything else:
return proxy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment