Created
November 7, 2012 15:35
-
-
Save egze/4032292 to your computer and use it in GitHub Desktop.
proxy script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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