Skip to content

Instantly share code, notes, and snippets.

@kylexlau
Created July 4, 2009 02: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 kylexlau/140406 to your computer and use it in GitHub Desktop.
Save kylexlau/140406 to your computer and use it in GitHub Desktop.
auto proxy javascript codes.
function FindProxyForURL(url, host)
{
var domain_list = [
// "wikipedia.org",
"blogspot.com",
"wordpress.com",
"flickr.com",
"feedburner.com",
"v2ex.com",
"vox.com"
];
for (var i = domain_list.length - 1; i >= 0; i--){
if (dnsDomainIs(host,domain_list[i])) {return "PROXY 127.0.0.1:8118"}
};
return "DIRECT"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment