Last active
December 16, 2018 09:57
-
-
Save chenshaoju/84bce1eae2a7974f41430b199d37d532 to your computer and use it in GitHub Desktop.
pac2
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 = [ | |
"gvt1.com", | |
"gvt2.com", | |
"talk.google.com", | |
"google.com", | |
"googledrive.com", | |
"google-analytics.com", | |
"ytimg.com", | |
"googleapis.com", | |
"googleusercontent.com", | |
"gstatic.com", | |
"virustotal.com", | |
"maniaplanet.com", | |
"whatsmyuseragent.com", | |
"pki.goog", | |
"steampowered.com", | |
"steamcommunity.com", | |
"steamstatic.com", | |
"akamaihd.net", | |
"steam-chat.com", | |
"bscstorage.net", | |
"ubi.com", | |
"ubisoft.com", | |
"uplay.com", | |
"ea.com", | |
"origin.com" | |
]; | |
for (var i = 0; i < list.length; 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