Skip to content

Instantly share code, notes, and snippets.

@egze
Created November 7, 2012 15:35
Show Gist options
  • Save egze/4032292 to your computer and use it in GitHub Desktop.
Save egze/4032292 to your computer and use it in GitHub Desktop.
proxy script
function FindProxyForURL(url, host) {
var usa = ['hulu.com', 'netflix.com', 'abc.go.com', 'pandora.com', 'aetv.com', 'adultswim.com', 'bravotv.com', 'rdio.com'];
var direct = ['ll.a.hulu.com', 'ads.hulu.com', 'ak.rdio.com', 'stats.pandora.com', 'pubsub1.rdio.com'];
for(var i=0;i<direct.length;i++){
if(host.indexOf(direct[i]) > -1){
return 'DIRECT';
}
}
if(host.match(/audio.*\.pandora\.com/) || host.match(/const.*\.pandora\.com/)){
return 'DIRECT';
}
for(var i=0;i<usa.length;i++){
if(host.indexOf(usa[i]) > -1){
return 'PROXY 50.116.59.63:80';
}
}
return 'DIRECT';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment