forked from PeterDaveHello/YZU-Proxy-PAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy.orig.pac
115 lines (106 loc) · 4.3 KB
/
proxy.orig.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function FindProxyForURL(url, host) {
var dt = 'DIRECT';
//direct
if (isPlainHostName(host)
|| dnsDomainIs(host, 'yzu.edu.tw')
|| dnsDomainIs(host, 'mediafire.com') //IP limit
|| dnsDomainIs(host, 'localhost')
|| dnsDomainIs(host, 'cse.tw')
)
return dt;
var prefix = 'PROXY proxy';
var postfix = '.yzu.edu.tw:8080;';
var proxy2 = prefix + '2' + postfix;
var proxy6 = prefix + '6' + postfix;
if (dnsDomainIs(host, 'mobile01.com')
|| dnsDomainIs(host, 'tw.yahoo.com')
|| dnsDomainIs(host, 'tw.news.yahoo.com')
|| dnsDomainIs(host, 'youtube.com')
|| dnsDomainIs(host, 'youtu.be')
|| dnsDomainIs(host, '1e100.net')
|| dnsDomainIs(host, 'appledaily.com.tw')
|| dnsDomainIs(host, 'ettoday.net')
|| dnsDomainIs(host, 'ck101.com')
|| dnsDomainIs(host, 'techbang.com')
|| dnsDomainIs(host, 'pixnet.net')
|| dnsDomainIs(host, 'xuite.net')
|| dnsDomainIs(host, 'wikipedia.org')
|| dnsDomainIs(host, '24h.pchome.com.tw')
|| dnsDomainIs(host, 'shopping.pchome.com.tw')
|| dnsDomainIs(host, 'ruten.com.tw')
|| dnsDomainIs(host, 'rimg.com.tw')//ruten image
|| dnsDomainIs(host, 'coolpc.com.tw')
|| dnsDomainIs(host, 'vimeo.com')
|| dnsDomainIs(host, 'hamicloud.net')
|| dnsDomainIs(host, 'ptt.cc')
|| dnsDomainIs(host, 'jsdelivr.net')
|| dnsDomainIs(host, 'cdnjs.cloudflare.com')
|| dnsDomainIs(host, 'yam.com')
|| dnsDomainIs(host, 'cht.tw')
|| dnsDomainIs(host, 'sourceforge.net')
|| (dnsDomainIs(host, 'hinet.net') && !dnsDomainIs(host, 'hichannel.hinet.net') && !dnsDomainIs(host, 'cpbl-hichannel.cdn.hinet.net'))
|| dnsDomainIs(host, 'tra.gov.tw')
|| dnsDomainIs(host, 'autobuy.tw')
|| dnsDomainIs(host, 'edu.tw')
|| dnsDomainIs(host, 'jorsindo.com')
|| dnsDomainIs(host, 'reddit.com')
|| dnsDomainIs(host, 'net.tw')
|| dnsDomainIs(host, 'nchc.org.tw')
|| dnsDomainIs(host, 'twaren.net')
|| dnsDomainIs(host, 'ati.com')
|| dnsDomainIs(host, 'amd.com')
|| dnsDomainIs(host, 'tw.freebsd.org')
|| dnsDomainIs(host, 'sitetag.us')
|| dnsDomainIs(host, 'edgesuite.net')
)
return proxy2 + proxy6 + dt;
var proxy3 = prefix + '3' + postfix;
if (dnsDomainIs(host, 'imgur.com')
|| dnsDomainIs(host, 'kkbox.com')
|| dnsDomainIs(host, 'tw.taobao.com')
|| dnsDomainIs(host, 'microsoft.com')
|| dnsDomainIs(host, 'github.com')
|| dnsDomainIs(host, 'github.io')
|| dnsDomainIs(host, 'githubusercontent.com')
|| dnsDomainIs(host, 'xiaomi.com')
|| dnsDomainIs(host, 'hichannel.hinet.net')
|| dnsDomainIs(host, 'cnet.com')
|| dnsDomainIs(host, 'dd-wrt.com')
)
return proxy3 + proxy6 + dt;
if (dnsDomainIs(host,'cpbl-hichannel.cdn.hinet.net'))
return '1007.cse.yzu.edu.tw:3128;DIRECT';
var ip = dnsResolve(host);
if (isInNet(ip, '140.138.0.0', '255.255.0.0')
|| isInNet(ip, '192.168.0.0', '255.255.0.0')
|| isInNet(ip, '127.0.0.0', '255.0.0.0')
|| isInNet(ip, '10.0.0.0', '255.0.0.0')
|| isInNet(ip, '172.16.0.0', '255.240.0.0')
)
return dt;
if (isInNet(ip, '140.112.0.0', '255.240.0.0')
|| isInNet(ip, '140.128.0.0', '255.240.0.0')
|| isInNet(ip, '134.208.0.0', '255.255.0.0')
|| isInNet(ip, '163.13.0.0', '255.252.0.0')
|| isInNet(ip, '163.15.0.0', '255.255.0.0')
|| isInNet(ip, '163.19.116.0', '255.255.255.0')
|| isInNet(ip, '163.21.98.0', '255.255.255.0')
|| isInNet(ip, '163.22.0.0', '255.255.0.0')
|| isInNet(ip, '163.32.84.0', '255.255.255.0')
|| isInNet(ip, '192.83.167.0', '255.255.224.0')
|| isInNet(ip, '192.83.186.0', '255.255.255.0')
|| isInNet(ip, '192.83.192.0', '255.255.252.0')
|| isInNet(ip, '192.192.0.0', '255.255.0.0')
|| isInNet(ip, '120.107.0.0', '255.255.0.0')
|| isInNet(ip, '120.109.0.0', '255.255.128.0')
|| isInNet(ip, '120.113.0.0', '255.255.128.0')
|| isInNet(ip, '120.125.86.0', '255.255.255.0')
|| isInNet(ip, '203.64.0.0', '255.255.0.0')
|| isInNet(ip, '203.71.84.0', '255.255.240.0')
|| isInNet(ip, '210.71.78.0', '255.255.255.0')
|| isInNet(ip, '210.71.118.0', '255.255.255.0')
|| isInNet(ip, '211.75.81.81', '255.255.255.255')
)
return proxy2 + proxy6 + dt;
return proxy6 + proxy3 + dt;
}