forked from guileen/config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfw.pac
40 lines (35 loc) · 1.04 KB
/
gfw.pac
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
var direct = 'DIRECT',
http_proxy = 'proxy localhost:8888',
socks = 'SOCKS5 127.0.0.1:8888',
all = direct + '; ' + socks;
function FindProxyForURL(url, host) {
if (host == 'raw.github.com') {
alert('github direct ' + url);
return direct;
}
if (shExpMatch(host, "*google.com") ||
shExpMatch(host, "*gmail.com") ||
shExpMatch(host, "*adobe.com") ||
shExpMatch(host, "*wikipedia.com") ||
shExpMatch(url, "*blogspot.com*") ||
shExpMatch(url, "*wordpress.com*") ||
shExpMatch(host, "*twitter.com") ||
shExpMatch(host, "*youtube.com") ||
shExpMatch(host, "*ytimg.com") ||
// dev site
shExpMatch(host, "*craftyjs.com") ||
shExpMatch(host, "*lesscss.org") ||
shExpMatch(host, "*tumblr.com") ||
// facebook
shExpMatch(host, "*facebook.com")
) {
alert('socks ' + url);
return socks;
}
if (isInNet(host, "192.168.0.0", "10.0.0.0", "255.0.0.0") ||
isPlainHostName(host)){
alert('direct ' + url);
return direct;
}
return all;
}