Skip to content

Instantly share code, notes, and snippets.

@arsatiki
Created July 7, 2010 08:11
Show Gist options
  • Save arsatiki/466454 to your computer and use it in GitHub Desktop.
Save arsatiki/466454 to your computer and use it in GitHub Desktop.
function FindProxyForURL(url, host) {
var socked = ["*.wikipedia.org", "twitter.com"];
var proxied = ["*simpletext.ws", "api.twitter.com"];
var i;
for (i = 0; i < socked.length; i++) {
if shExpMatch(url, socked[i])
return "SOCKS 10.0.2.3:9999";
}
for (i = 0; i < proxied.length; i++) {
if shExpMatch(url, proxied[i])
return "PROXY 10.0.2.3:9998; DIRECT";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment