-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpac_wilson.js
55 lines (50 loc) · 1.13 KB
/
pac_wilson.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var deny='PROXY 127.0.0.1:21';
var proxy='PROXY 127.0.0.1:8087';
var Deny = {
"qiyou.com":false
};
var Proxy = {
"twitter.com":true,
"google.com":true,
"t.co":true,
"wikipedia.org":true,
"feedburner.com":true,
"youtube.com":true,
"ytimg.com":true,
"blogspot.com":true,
"nytimes.com":true,
"googleusercontent.com":true,
"gstatic.com":true,
"boxun.com":true,
"bit.ly":true,
"trello.com":true,
"facebook.com":true,
"ju.mp":true,
"googleapis.com":true,
"appspot.com":true,
"t66y.com":true,
"stackoverflow.com":true,
"golang.org":true,
"developer.mozilla.org":true,
"laravel.io":true,
"googlecode.com":true,
"html5index.org":true,
"maven.org":true,
"googlesource.com":true,
"github.com":true,
"jetbrains.com":true,
"jayway.com":true
};
function FindProxyForURL(url, host) {
var lastPos = 0;
var domain = host;
while(lastPos >= 0) {
if( ( typeof Deny[domain] ) != "undefined" )
return deny;
if( ( typeof Proxy[domain] ) != "undefined" )
return proxy;
lastPos = host.indexOf('.', lastPos + 1);
domain = host.slice(lastPos + 1);
}
return 'DIRECT';
}