block-proxy 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -1
- package/build/asset-manifest.json +3 -3
- package/build/index.html +1 -1
- package/build/static/js/{main.68f66be0.js → main.af1923ea.js} +3 -3
- package/build/static/js/main.af1923ea.js.map +1 -0
- package/config.json +6 -224
- package/package.json +2 -2
- package/proxy/proxy.js +2 -21
- package/src/App.js +0 -10
- package/build/static/js/main.68f66be0.js.map +0 -1
- /package/build/static/js/{main.68f66be0.js.LICENSE.txt → main.af1923ea.js.LICENSE.txt} +0 -0
package/config.json
CHANGED
|
@@ -1,227 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"progress_time_stamp": "1766571511705",
|
|
4
|
-
"block_hosts": [
|
|
5
|
-
{
|
|
6
|
-
"filter_host": "bilibili.com",
|
|
7
|
-
"filter_match_rule": "",
|
|
8
|
-
"filter_start_time": "00:00",
|
|
9
|
-
"filter_end_time": "23:59",
|
|
10
|
-
"filter_weekday": [
|
|
11
|
-
1,
|
|
12
|
-
2,
|
|
13
|
-
3,
|
|
14
|
-
4,
|
|
15
|
-
5,
|
|
16
|
-
6,
|
|
17
|
-
7
|
|
18
|
-
],
|
|
19
|
-
"filter_mac": "6E:FB:18:4D:9C:3E"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"filter_host": "doubao.com",
|
|
23
|
-
"filter_match_rule": "",
|
|
24
|
-
"filter_start_time": "00:00",
|
|
25
|
-
"filter_end_time": "23:59",
|
|
26
|
-
"filter_weekday": [
|
|
27
|
-
1,
|
|
28
|
-
2,
|
|
29
|
-
3,
|
|
30
|
-
4,
|
|
31
|
-
5,
|
|
32
|
-
6,
|
|
33
|
-
7
|
|
34
|
-
],
|
|
35
|
-
"filter_mac": "6E:FB:18:4D:9C:3E"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"filter_host": "dburl.net",
|
|
39
|
-
"filter_match_rule": "",
|
|
40
|
-
"filter_start_time": "00:00",
|
|
41
|
-
"filter_end_time": "23:59",
|
|
42
|
-
"filter_weekday": [
|
|
43
|
-
1,
|
|
44
|
-
2,
|
|
45
|
-
3,
|
|
46
|
-
4,
|
|
47
|
-
5,
|
|
48
|
-
6,
|
|
49
|
-
7
|
|
50
|
-
],
|
|
51
|
-
"filter_mac": "6E:FB:18:4D:9C:3E"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"filter_host": "baidu.com",
|
|
55
|
-
"filter_match_rule": "",
|
|
56
|
-
"filter_start_time": "00:00",
|
|
57
|
-
"filter_end_time": "23:59",
|
|
58
|
-
"filter_weekday": [
|
|
59
|
-
1,
|
|
60
|
-
2,
|
|
61
|
-
3,
|
|
62
|
-
4,
|
|
63
|
-
5,
|
|
64
|
-
6,
|
|
65
|
-
7
|
|
66
|
-
],
|
|
67
|
-
"filter_mac": "6E:FB:18:4D:9C:3E"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"filter_host": "youtube.com",
|
|
71
|
-
"filter_match_rule": "^https?:\\/\\/(www|s)\\.youtube\\.com\\/(pagead|ptracking)",
|
|
72
|
-
"filter_start_time": "00:00",
|
|
73
|
-
"filter_end_time": "23:59",
|
|
74
|
-
"filter_weekday": [
|
|
75
|
-
1,
|
|
76
|
-
2,
|
|
77
|
-
3,
|
|
78
|
-
4,
|
|
79
|
-
5,
|
|
80
|
-
6,
|
|
81
|
-
7
|
|
82
|
-
],
|
|
83
|
-
"compiledFilterRegexp": {}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"filter_host": "youtube.com",
|
|
87
|
-
"filter_match_rule": "^https?:\\/\\/s\\.youtube\\.com\\/api\\/stats\\/qoe\\?adcontext",
|
|
88
|
-
"filter_start_time": "00:00",
|
|
89
|
-
"filter_end_time": "23:59",
|
|
90
|
-
"filter_weekday": [
|
|
91
|
-
1,
|
|
92
|
-
2,
|
|
93
|
-
3,
|
|
94
|
-
4,
|
|
95
|
-
5,
|
|
96
|
-
6,
|
|
97
|
-
7
|
|
98
|
-
],
|
|
99
|
-
"compiledFilterRegexp": {}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"filter_host": "youtube.com",
|
|
103
|
-
"filter_match_rule": "^https?:\\/\\/(www|s)\\.youtube\\.com\\/api\\/stats\\/ads",
|
|
104
|
-
"filter_start_time": "00:00",
|
|
105
|
-
"filter_end_time": "23:59",
|
|
106
|
-
"filter_weekday": [
|
|
107
|
-
1,
|
|
108
|
-
2,
|
|
109
|
-
3,
|
|
110
|
-
4,
|
|
111
|
-
5,
|
|
112
|
-
6,
|
|
113
|
-
7
|
|
114
|
-
],
|
|
115
|
-
"compiledFilterRegexp": {}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"filter_host": "googlevideo.com",
|
|
119
|
-
"filter_match_rule": "^https?:\\/\\/[\\w-]+\\.googlevideo\\.com\\/(?!(dclk_video_ads|videoplayback\\?)).+&oad",
|
|
120
|
-
"filter_start_time": "00:00",
|
|
121
|
-
"filter_end_time": "23:59",
|
|
122
|
-
"filter_weekday": [
|
|
123
|
-
1,
|
|
124
|
-
2,
|
|
125
|
-
3,
|
|
126
|
-
4,
|
|
127
|
-
5,
|
|
128
|
-
6,
|
|
129
|
-
7
|
|
130
|
-
],
|
|
131
|
-
"compiledFilterRegexp": {}
|
|
132
|
-
}
|
|
133
|
-
],
|
|
2
|
+
"block_hosts": [],
|
|
134
3
|
"proxy_port": 8001,
|
|
135
|
-
"web_interface_port": 8003,
|
|
136
|
-
"your_domain": "yui.cool",
|
|
137
|
-
"vpn_proxy": "",
|
|
138
|
-
"auth_username": "lijing",
|
|
139
|
-
"auth_password": "lijing",
|
|
140
|
-
"enable_express": "1",
|
|
141
|
-
"enable_socks5": "1",
|
|
142
4
|
"socks5_port": 8002,
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"ip": "192.168.124.2",
|
|
151
|
-
"mac": "7C:DE:78:A9:83:A0"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"ip": "192.168.124.6",
|
|
155
|
-
"mac": "0:DD:B6:EB:26:5C"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"ip": "192.168.124.10",
|
|
159
|
-
"mac": "FA:27:3C:E5:31:5F"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"ip": "192.168.124.34",
|
|
163
|
-
"mac": "D6:A0:61:69:67:F6"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"ip": "192.168.124.37",
|
|
167
|
-
"mac": "DE:1E:87:ED:17:8B"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"ip": "192.168.124.49",
|
|
171
|
-
"mac": "62:A1:CC:42:55:E4"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"ip": "192.168.124.107",
|
|
175
|
-
"mac": "6:26:EA:5A:9E:6C"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"ip": "192.168.124.111",
|
|
179
|
-
"mac": "74:3F:C2:67:74:98"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"ip": "192.168.124.125",
|
|
183
|
-
"mac": "14:C0:50:14:6E:A5"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"ip": "192.168.124.128",
|
|
187
|
-
"mac": "48:F3:F3:CA:1D:E"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"ip": "192.168.124.200",
|
|
191
|
-
"mac": "54:52:84:95:DF:5E"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"ip": "192.168.124.240",
|
|
195
|
-
"mac": "F4:6B:8C:90:29:5"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
"ip": "192.168.124.251",
|
|
199
|
-
"mac": "6E:FB:18:4D:9C:3E"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"ip": "192.168.124.3",
|
|
203
|
-
"mac": "0:DD:B6:EA:E6:2A"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"ip": "192.168.124.64",
|
|
207
|
-
"mac": "76:39:29:EF:3:94"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"ip": "192.168.124.66",
|
|
211
|
-
"mac": "E2:4D:6E:1:21:6E"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"ip": "192.168.124.91",
|
|
215
|
-
"mac": "BA:5A:91:BE:7D:ED"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"ip": "192.168.124.232",
|
|
219
|
-
"mac": "DC:97:58:D:FD:9F"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"ip": "192.168.124.252",
|
|
223
|
-
"mac": "82:41:4F:6F:89:C2"
|
|
224
|
-
}
|
|
225
|
-
],
|
|
226
|
-
"enable_mitm": "1"
|
|
227
|
-
}
|
|
5
|
+
"auth_username": "admin",
|
|
6
|
+
"auth_password": "admin",
|
|
7
|
+
"enable_express": "1",
|
|
8
|
+
"enable_socks5": "1"
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "block-proxy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Small-scale network mitm proxy filter",
|
|
5
5
|
"bin": {
|
|
6
6
|
"block-proxy": "bin/start.js"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"eject": "react-scripts eject"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@bachi/anyproxy": "^0.1.
|
|
40
|
+
"@bachi/anyproxy": "^0.1.6",
|
|
41
41
|
"@craco/craco": "^7.1.0",
|
|
42
42
|
"axios": "^1.13.2",
|
|
43
43
|
"commander": "^14.0.2",
|
package/proxy/proxy.js
CHANGED
|
@@ -42,7 +42,7 @@ var anyproxy_started = false;
|
|
|
42
42
|
var blockHosts = [];
|
|
43
43
|
var proxyPort = 8001; // http 代理端口
|
|
44
44
|
var socks5Port = 8002; // socks5 端口
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
var vpn_proxy = "";
|
|
47
47
|
var devices = [];
|
|
48
48
|
var progress_time_stamp = "";
|
|
@@ -57,7 +57,7 @@ var is_running_in_docker = false;
|
|
|
57
57
|
var docker_host_IP = '';
|
|
58
58
|
var enable_express = "1"; // "0", "1"
|
|
59
59
|
var enable_socks5 = "1";
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
var enable_mitm = "1"; // "0", "1",是否对 HTTPS 启用 MITM 解密(关闭后纯隧道转发,不拦截)
|
|
62
62
|
// 域名判断,区分浏览器和 App
|
|
63
63
|
var filtered_mitm_domains = [
|
|
@@ -218,7 +218,6 @@ async function loadConfig() {
|
|
|
218
218
|
progress_time_stamp: progress_time_stamp,
|
|
219
219
|
block_hosts: blockHosts,
|
|
220
220
|
proxy_port: proxyPort,
|
|
221
|
-
web_interface_port: webInterfacePort,
|
|
222
221
|
your_domain: your_domain,
|
|
223
222
|
vpn_proxy:"",
|
|
224
223
|
auth_username:"",
|
|
@@ -226,7 +225,6 @@ async function loadConfig() {
|
|
|
226
225
|
enable_express: enable_express,
|
|
227
226
|
enable_socks5: enable_socks5,
|
|
228
227
|
socks5_port: socks5Port,
|
|
229
|
-
enable_webinterface: enable_webinterface,
|
|
230
228
|
devices: []
|
|
231
229
|
};
|
|
232
230
|
|
|
@@ -277,9 +275,6 @@ async function loadConfig() {
|
|
|
277
275
|
enable_socks5 = loadedConfig.enable_socks5;
|
|
278
276
|
config.enable_socks5 = enable_socks5;
|
|
279
277
|
|
|
280
|
-
enable_webinterface = loadedConfig.enable_webinterface;
|
|
281
|
-
config.enable_webinterface = enable_webinterface;
|
|
282
|
-
|
|
283
278
|
enable_mitm = loadedConfig.enable_mitm || "1"; // 默认开启,兼容旧配置文件缺少此字段
|
|
284
279
|
config.enable_mitm = enable_mitm;
|
|
285
280
|
|
|
@@ -294,11 +289,6 @@ async function loadConfig() {
|
|
|
294
289
|
config.proxy_port = proxyPort;
|
|
295
290
|
}
|
|
296
291
|
|
|
297
|
-
if (loadedConfig.web_interface_port) {
|
|
298
|
-
webInterfacePort = loadedConfig.web_interface_port;
|
|
299
|
-
config.web_interface_port = webInterfacePort;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
292
|
if (loadedConfig.devices) {
|
|
303
293
|
devices = loadedConfig.devices;
|
|
304
294
|
config.devices = devices;
|
|
@@ -311,14 +301,12 @@ async function loadConfig() {
|
|
|
311
301
|
progress_time_stamp: progress_time_stamp,
|
|
312
302
|
block_hosts: blockHosts,
|
|
313
303
|
proxy_port: proxyPort,
|
|
314
|
-
web_interface_port: webInterfacePort,
|
|
315
304
|
auth_password:"",
|
|
316
305
|
auth_username:"",
|
|
317
306
|
enable_express: enable_express,
|
|
318
307
|
your_domain: your_domain,
|
|
319
308
|
socks5_port: socks5Port,
|
|
320
309
|
enable_socks5: enable_socks5,
|
|
321
|
-
enable_webinterface: enable_webinterface,
|
|
322
310
|
enable_mitm: enable_mitm,
|
|
323
311
|
vpn_proxy: ""
|
|
324
312
|
});
|
|
@@ -523,9 +511,6 @@ function startProxyServer() {
|
|
|
523
511
|
|
|
524
512
|
proxyServerInstance.on('ready', () => {
|
|
525
513
|
console.log(`✅ \x1b[32mHTTP 代理服务启动,IP: ${localIp}, 端口: ${proxyPort}\x1b[0m`);
|
|
526
|
-
if (enable_webinterface == "1") {
|
|
527
|
-
console.log(`✅ \x1b[32mAnyProxy 监控面板启动,http://${localIp}:${webInterfacePort}\x1b[0m`);
|
|
528
|
-
}
|
|
529
514
|
});
|
|
530
515
|
|
|
531
516
|
proxyServerInstance.on('error', (e) => {
|
|
@@ -1349,10 +1334,6 @@ function getAnyProxyOptions() {
|
|
|
1349
1334
|
},
|
|
1350
1335
|
|
|
1351
1336
|
},
|
|
1352
|
-
webInterface: {
|
|
1353
|
-
enable: enable_webinterface == "1" ? true : false,
|
|
1354
|
-
webPort: webInterfacePort
|
|
1355
|
-
},
|
|
1356
1337
|
throttle: 800 * 1024 * 1024, // 800 Mbps
|
|
1357
1338
|
forceProxyHttps: false, // 关闭全局 HTTPS 拦截
|
|
1358
1339
|
wsIntercept: false,
|
package/src/App.js
CHANGED
|
@@ -20,7 +20,6 @@ function App() {
|
|
|
20
20
|
block_hosts: [],
|
|
21
21
|
proxy_port: 8001,
|
|
22
22
|
socks5_port:8002,
|
|
23
|
-
web_interface_port: 8003,
|
|
24
23
|
auth_username: "",
|
|
25
24
|
auth_password: "",
|
|
26
25
|
});
|
|
@@ -580,15 +579,6 @@ function App() {
|
|
|
580
579
|
onChange={(e) => setConfig({...config, socks5_port: parseInt(e.target.value) || 8002})}
|
|
581
580
|
/>
|
|
582
581
|
</div>
|
|
583
|
-
|
|
584
|
-
<div className="setting-row">
|
|
585
|
-
<label>Anyproxy 监控端口:</label>
|
|
586
|
-
<input
|
|
587
|
-
type="number"
|
|
588
|
-
value={config.web_interface_port}
|
|
589
|
-
onChange={(e) => setConfig({...config, web_interface_port: parseInt(e.target.value) || 8003})}
|
|
590
|
-
/>
|
|
591
|
-
</div>
|
|
592
582
|
|
|
593
583
|
<div className="setting-row">
|
|
594
584
|
<label>代理用户名:</label>
|