-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPAC.js
38 lines (34 loc) · 860 Bytes
/
PAC.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function FindProxyForURL(url, host) {
var OUT_WALLS = [
// 谷歌系
/\.??google.com/,
/\.??youtube.com/,
/\.??android.com/,
// 国外社交系
/\.??facebook.com/,
/\.??twitter.com/,
/\.??vimeo.com/,
// 程序员系
/\.??github.com/,
/\.??github.io/,
/\.??stackoverflow.com/,
/\.??codepen.io/,
/\.??jsfiddle.net/,
// 其它系
/\.??engadget.com/,
/\.??amazon.com/,
/\.??live.com/,
/\.??microsoft.com/,
/\.??wikipedia.org/
]
var PROXYS = [
"PROXY 10.16.13.18:8080",
"PROXY proxy.corp.qihoo.net:8080"
].join(";")
for (var i = 0; i < OUT_WALLS.length; i++ ) {
if (OUT_WALLS[i].test(host)) {
return PROXYS;
}
}
return "DIRECT";
}