Created
August 12, 2017 04:30
-
-
Save chenshaoju/68f369d099e08d4f9c676771c6c7c8fb to your computer and use it in GitHub Desktop.
pac for qq.com
This file contains hidden or 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 isMatchProxy(url, pattern) { | |
try { | |
return new RegExp(pattern.replace('.', '\\.')).test(url); | |
} catch (e) { | |
return false; | |
} | |
} | |
function FindProxyForURL(url, host) { | |
var Proxy = 'PROXY 127.0.0.1:10800'; | |
var list = [ | |
'qq.com' | |
]; | |
for(var i=0, l=list.length; i<l; i++) { | |
if (isMatchProxy(url, list[i])) { | |
return Proxy; | |
} | |
} | |
return 'DIRECT'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment