Daily update
[cnwhitelist.git] / cnwhitelist.pac
blobd926ee63760467698071454bf34e27c0d1e60f35
1 //=============================================
2 // PROXY WHITELIST FOR CHINESE WEBSITE
3 //---------------------------------------------
4 // Maintained by Tunghsiao Liu (sparanoid.com)
5 //---------------------------------------------
6 // Add this .pac file to your system proxy
7 // settings under internet configuration. You 
8 // may also need to change your DNS.
9 // If you have problem with local pac on Lion, 
10 // try to fire up a localhost like this:
11 // http://localhost:8888/cnwhitelist/cnwhitelist.pac
12 //=============================================
14 // Variables
15 var direct = direct;
17 // Change your proxy here. Just FYI You can add 
18 // multiple failback proxies.
19 //---------------------------------------------
20 var proxy = "SOCKS5 127.0.0.1:3333; SOCKS 127.0.0.1:3333; DIRECT";
22 function FindProxyForURL(url, host) {
24         // Bypass Local Networks
25         if (isPlainHostName(host)) {
26                 return direct;
27         }
29         // Known IPs
30         var resolved_ip = dnsResolve(host);
32         if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") ||
33                 isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
34                 isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
35                 isInNet(resolved_ip, "127.0.0.0", "255.255.255.0")) {
36                 return direct;
37         }
39         // Known Domains
40         var whitelist = [
41                 // Have to use proxy or it dosen"t work.
42                 //---------------------------------------------
43                 "*://ip138.com/*",
44                 "*://*.ip138.com/*",
46                 // Assume all .cn domains use Chienses servers.
47                 // So no need to re-add specified domains.
48                 //---------------------------------------------
49                 "*://*.cn/*",
51                 // Web Portals / News / Emails
52                 //---------------------------------------------
53                 "*://163.com/*",
54                 "*://*.163.com/*",
56                         "*://netease.com/*",
57                         "*://*.netease.com/*",
59                         "*://126.net/*",
60                         "*://*.126.net/*",
62                 "*://126.com/*",
63                 "*://*.126.com/*",
65                 "*://yeah.net/*",
66                 "*://*.yeah.net/*",
68                 "*://sohu.com/*",
69                 "*://*.sohu.com/*",
71                         "*://sogou.com/*",
72                         "*://*.sogou.com/*",
74                 "*://qq.com/*",
75                 "*://*.qq.com/*",
77                 "*://sdo.com/*",
78                 "*://*.sdo.com/*",
80                         "*://staticsdo.com/*",
81                         "*://*.staticsdo.com/*",
83                 // Weibos
84                 //---------------------------------------------
85                 "*://weibo.com/*",
86                 "*://*.weibo.com/*",
88                 // Search Engines
89                 //---------------------------------------------
90                 "*://zdic.net/*",
91                 "*://*.zdic.net/*",
93                 "*://baidu.com/*",
94                 "*://*.baidu.com/*",
96                         "*://bdimg.com/*",
97                         "*://*.bdimg.com/*",
99                 "*://cidianwang.com/*",
100                 "*://*.cidianwang.com/*",
102                 // Social Networks
103                 //---------------------------------------------
104                 "*://renren.com/*",
105                 "*://*.renren.com/*",
107                 "*://douban.com/*",
108                 "*://*.douban.com/*",
110                 "*://zhihu.com/*",
111                 "*://*.zhihu.com/*",
113                         "*://yupoo.com/*",
114                         "*://*.yupoo.com/*",
116                 "*://weiphone.com/*",
117                 "*://*.weiphone.com/*",
119                 "*://pcbeta.com/*",
120                 "*://*.pcbeta.com/*",
122                 "*://moko.cc/*",
123                 "*://*.moko.cc/*",
125                         "*://moko.hk/*",
126                         "*://*.moko.hk/*",
128                 // Shopping Sites
129                 //---------------------------------------------
130                 "*://taobao.com/*",
131                 "*://*.taobao.com/*",
133                         "*://taobaocdn.com/*",
134                         "*://*.taobaocdn.com/*",
136                         "*://atpanel.com/*",
137                         "*://*.atpanel.com/*",
139                 "*://tmall.com/*",
140                 "*://*.tmall.com/*",
142                 "*://alipay.com/*",
143                 "*://*.alipay.com/*",
145                 "*://alibaba.com/*",
146                 "*://*.alibaba.com/*",
148                         "*://aliimg.com/*",
149                         "*://*.aliimg.com/*",
151                 "*://360buy.com/*",
152                 "*://*.360buy.com/*",
154                         "*://360buyimg.com/*",
155                         "*://*.360buyimg.com/*",
157                 "*://eachnet.com/*",
158                 "*://*.eachnet.com/*",
160                 "*://icson.com/*",
161                 "*://*.icson.com/*",
163                 "*://yihaodian.com/*",
164                 "*://*.yihaodian.com/*",
166                         "*://yihaodianimg.com",
167                         "*://*.yihaodianimg.com",
169                 "*://vancl.com/*",
170                 "*://*.vancl.com/*",
172                         "*://vanclimg.com",
173                         "*://*.vanclimg.com",
175                 // Banks
176                 //---------------------------------------------
177                 "*://cmbchina.com/*",
178                 "*://*.cmbchina.com/*",
180                         "*://bankofchina.com/*",
181                         "*://*.bankofchina.com/*",
183                 "*://ccb.com/*",
184                 "*://*.ccb.com/*",
186                 // Telecommunications
187                 //---------------------------------------------
188                 "*://10010.com/*",
189                 "*://*.10010.com/*",
191                 "*://ct10000.com/*",
192                 "*://*.ct10000.com/*",
194                 // Express Delivery
195                 //---------------------------------------------
196                 "*://sf-express.com/*",
197                 "*://*.sf-express.com/*",
199                 // ACG
200                 //---------------------------------------------
201                 "*://ra.gg/*",
202                 "*://*.ra.gg/*",
204                         "*://mukkyu.com/*",
205                         "*://*.mukkyu.com/*",
207                 "*://jsharer.com/*",
208                 "*://*.jsharer.com/*",
210                 "*://moeid.com/*",
211                 "*://*.moeid.com/*",
213                 "*://030buy.com/*",
214                 "*://*.030buy.com/*",
216                 "*://saraba1st.com/*",
217                 "*://*.saraba1st.com/*",
219                 "*://ktxp.com/*",
220                 "*://*.ktxp.com/*",
222                 // Other
223                 //---------------------------------------------
224                 "*://feidee.com/*",
225                 "*://*.feidee.com/*",
227                 // Webmaster / Counter
228                 //---------------------------------------------
229                 "*://51.la/*",
230                 "*://*.51.la/*",
232                 "*://cnzz.com/*",
233                 "*://*.cnzz.com/*",
235                 "*://google-analytics.com/*",
236                 "*://*.google-analytics.com/*",
238                 "*://jiankongbao.com/*",
239                 "*://*.jiankongbao.com/*",
241                 "*://frantech.ca/*",
242                 "*://*.frantech.ca/*",
244                 // Temporary / Debug
245                 //---------------------------------------------
246                 // Google Music
247                 "*://clients.google.com/*",
248                 "*://*.clients.google.com/*",
250                 // Powered by Tunghsiao Liu
251                 //---------------------------------------------
252                 "*://drrr.us/*",
253                 "*://*.drrr.us/*",
255                 "*://nio2.com/*",
256                 "*://*.nio2.com/*",
258                 "*://sparanoid.com/*",
259                 "*://*.sparanoid.com/*"
260         ];
262         for (var n=0; n < whitelist.length; n++) {
263                 if (shExpMatch(url, whitelist[n])) {
264                         return direct;
265                 }
266         }
268         return proxy;
271 // China is dangerous, Lets" go to Mars.