Skip to content

Instantly share code, notes, and snippets.

@shelbybark
Created November 1, 2010 15:34
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 shelbybark/658364 to your computer and use it in GitHub Desktop.
Save shelbybark/658364 to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
if (url.match(/:9080\//)) {
return "PROXY localhost:3129";
}
if (url.match(/\biago\b/) ||
url.match(/\babla\b/) ||
url.match(/\brove\b/) ||
url.match(/\bphpmyadmin\b/) ||
url.match(/\bcoptix\.lan\b/) ||
shExpMatch(url, "http://errors.flash.hosts.coptix.com/*") ||
shExpMatch(url, "http://ccc/*")) {
return "PROXY localhost:3128";
}
if (shExpMatch(url, "https:*")) {
return "DIRECT";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment