全球代理配置管理完全解决方案

背景

代理配置文件管理的痛点

  1. 配置文件不兼容
    Clash、小火箭需要不同类型的配置文件;
  2. 配置文件管理/同步困难
    小火箭、Stash等内置的基于iCloud的同步方案稳定性差,且无法跨平台、需要账号登录;
    缺少版本控制功能,难以回滚;
  3. 配置文件失效快
    服务商提供的订阅链接可能被和谐;
    订阅链接内的规则节点(Rule-Provider)可能被和谐;
    订阅链接内的节点可能被和谐;
  4. 服务商提供的订阅链接无法满足使用习惯
    默认订阅链接中存在一些节点广告;
    分组和分流规则不一定匹配个人需求;
    不同的服务商自带不同的分组和分流规则;
  5. 与NAS回流方案有一定的冲突
    主流的NAS回流方案,如TailScale、Zerotier等,使用时需要暂停其他代理服务,否则无法上网或出现意外的流量转发(代理服务->回流,或回流->代理服务)。

代理配置文件管理:从粗放到有序的发展阶段

  1. 直接使用服务商提供的订阅链接
    直接在代理服务中使用原始订阅链接,且不使用分流规则
    只在需要时启动代理服务,一般不使用
    每个平台都配置一遍订阅链接
    订阅链接被和谐后,登录服务商后台重新寻找新的订阅链接,并在每个平台重新配置一次
  2. 使用自己定制的独立配置文件
    当有免流、NAS回流、软件破解(Emby iOS、网易云音乐等)等特殊需求时,自行编写一个独立的配置文件,但没有与代理服务商提供的配置文件集成。使用时根据需要,切换不同的配置文件
  3. 使用订阅转换器
    当对代理服务商提供的订阅链接有更多高级需求时,使用如ACL4SSR等订阅转换器,实现更高级的分流、分组等效果
  4. 集成代理配置文件
    自行编写代理配置文件,集成了订阅转换器分组分流和NAS回流等多种功能,all in one配置文件
  5. 代理配置文件云同步
    使用Github Gist等云服务,上传all in one配置文件,一次编辑,处处同步

配置文件管理需求

  1. 一次编辑,处处同步
  2. 跨平台支持:Windows、iOS、MacOS、NAS、(Android暂缺)(软路由暂缺)
  3. 尽量减少订阅链接被和谐的影响
  4. 支持自定义分流,自定义分组规则,不受原始订阅链接影响
  5. 支持代理链(Relay),支持NAS回程,支持集成免流、破解等特殊需求

代理配置文件管理方案

概述

代理配置管理方案如上图所示。

  • 配置文件基于Clash YAML规则编写,上传至Github Gist;
  • 配置文件使用由Cloudflare Workers编写的配置路由(Config Router)反向代理下载,避免被和谐;
  • 配置文件指向的订阅链接(Proxy Providers)指向Cloudflare Workers的订阅反向代理(Sub Proxy),避免被和谐;
  • 订阅反向代理指向订阅转换器(Sub Converter),由订阅转换器下载代理服务商提供的原始订阅链接;
  • 配置文件指向的规则节点(Rule-Provider),为Ghproxy代理过的Github规则,避免被和谐。
  • NAS上使用的配置文件本体暂不支持云同步,需要手动更新对应的配置文件。

准备工作 (TODO:看看是否齐全)

  1. 注册一个Cloudflare免费帐号
  2. 拥有一个Github账户
  3. (强烈建议)拥有一个域名,并将Name Server解析至Cloudflare (TODO:教程)
  4. 准备一个Clash YAML配置文件,可参考第X节提供的配置文件 (TODO:位置)

Github Gist

GitHub Gist允许您存储和分发代码片段,而无需设置复杂的存储库。代码字符串、bash脚本、markdown、文本文件和其他小数据片段都是代码片段可接受的替代方案。它可用于快速将一段代码分发给其他人,以进行演示、操作方法或任何解决方案,而无需设置标准存储库。此外,您可以使用它嵌入其他地方或您的网站上。[1]

Github Gist用于提供一个配置文件上传、在线编辑、版本控制、云同步的平台。

打开Github Gist,上传Clash YAML配置文件,提供文件名为clash.yaml,并单击右下角的 Create secret gist(创建私密Gist)。

私密Gist不会出现在Github Gist首页推荐中,仅可通过直链访问。
单个Gist内可以上传多个文件。

在网页中点击上传后的clash.yaml文件右上角的Raw按钮,即可获得代理配置文件的访问直链,形如:

1
https://gist.githubusercontent.com/<username>/<gist-hash>/raw/<commit-hash>/clash.yaml

这个直链指向了这个Gist的特定commit版本,不会随着Gist的更新而改变内容。

一般我们需要能获取配置文件最新版本的直链,只需删除上述链接中的/<commit-hash>部分即可:

1
https://gist.githubusercontent.com/<username>/<gist-hash>/raw/clash.yaml

如果需要更新配置文件,可在Github Gist中在线编辑更新。

配置路由(Config Router)

配置路由是一个由Cloudflare Workers实现的Serverless函数,作用是提供配置文件的直链访问链接,形如:

1
2
https://cfg.mydomain.com/?cfg=clash
https://cfg.mydomain.com/?cfg=password

配置路由的作用:

  1. 反向代理Github,避免Github被和谐,导致难以访问Gist直链;
  2. 缩短配置文件链接,便于记忆;
  3. 可以路由至多个配置文件,便于保存多个配置文件/共享配置文件;
  4. 配置文件加密:相当于为配置文件自定义了一个访问口令。

创建Cloudflare Worker:

Cloudflare控制台首页 -> Workers & Pages -> Overview -> Create application -> Create worker

建议修改Name为一个有意义的值,如cfg

点击Deploy部署一个Hello World script。

然后点击Edit code进入代码编辑页面。

替换代码为以下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export default {
async fetch(request, env, ctx) {
const cfgMap = {
'clash': 'https://gist.githubusercontent.com/<username>/<gist-hash>/raw/clash.yaml'
}

const url = new URL(request.url);
const cfgKey = url.searchParams.get('cfg');

if (!cfgKey) {
return new Response('Config proxy service: Please add `cfg` query param.', { status: 400 });
}

const cfgUrl = cfgMap[cfgKey];
if (!cfgUrl) {
return new Response(`Config proxy service: cfg=${cfgKey} is not defined.`, { status: 400 });
}

const res = await fetch(cfgUrl, request);

return res;
},
};

cfgMap变量处的配置文件直链替换为你在上一步拿到的Gist直链。

然后点击Save and deploy

访问这个Worker默认提供的链接:

1
https://cfg.<zone-id>.workers.dev/?cfg=clash

可以看到返回了Github Gist的配置文件内容。

这段代码的作用是获取URL param中的cfg参数,根据参数匹配硬编码的配置文件地址,然后反向代理获取配置文件提供给访问者。当cfg参数缺失或未能匹配时,报错。
cfgMap变量可以添加更多数据,从而根据cfg参数不同,路由到不同的配置文件。

(强烈建议)为配置路由绑定自定义域名

这需要你有一个域名,并已将域名的Name Server解析至Cloudflare。
假设你的域名为mydomain.com

Cloudflare控制台首页 -> Workers & Pages -> Overview -> <你刚创建的Worker> -> Triggers -> Add Custom Domain

输入cfg.mydomain.com -> Add Custom Domain

稍等片刻,然后你应该可以通过以下链接访问Gist配置文件了:

1
https://cfg.mydomain.com/?cfg=clash

订阅反向代理(Sub Proxy)

订阅反向代理是一个由Cloudflare Workers实现的Serverless函数,作用是反向代理被和谐的订阅链接,适用于:

  • 代理服务商的原始订阅链接易被和谐
  • 订阅转换器的后端地址易被和谐
  • 订阅转换器的后端地址可能失效
  • 用新订阅链接重新配置一遍订阅转换器非常麻烦

类似地,创建一个名为sub的Cloudflare worker,代码如下:

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
export default {
// The fetch handler is invoked when this worker receives a HTTP(S) request
// and should return a Response (optionally wrapped in a Promise)
async fetch(request, env, ctx) {
const password = new URL(request.url).searchParams.get('pwd');

if (password !== 'mypassword') {
return new Response('Sub converter service: Please check `pwd` query param.', { status: 400 });
}

// sub conv默认的url
const baseUrl = 'https://{host}/sub?' +
'filename={filename}' +
'&url={url}' +
'&target=clash' +
'&new_name=true' +
'&insert=false' +
'&config=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2FSleepyHeeead%2Fsubconverter-config%40master%2Fremote-config%2Fspecial%2Fbasic.ini' +
// '&exclude=%E5%89%A9%E4%BD%99%E6%B5%81%E9%87%8F%7C%E6%8E%A8%E8%8D%90' +
'&emoji=true' +
'&list=false' +
'&tfo=false' +
'&scv=false' +
'&fdn=false' +
'&sort=false';
// 想要的sub conv后端url
const host = 'sub.maoxiongnet.com'
// 想要的机场订阅url
const url = 'https://<some-domain>/api/v1/client/subscribe?token=<some-token>'
// 想要自动显示出的订阅文件名
const filename = '某某云'

const newUrl = baseUrl
.replace('{host}', host)
.replace('{filename}', encodeURIComponent(filename))
.replace('{url}', encodeURIComponent(url));

console.log(newUrl);

const response = await fetch(newUrl, request);

return response;
},
};

替换baseUrlhosturlfilename为真实值:

  • baseUrl:订阅转换器直接生成的订阅链接。
    你可以访问订阅转换器,输入代理服务商提供的原始订阅链接,并按照你的个人喜好随意配置转换策略,并生成订阅链接。
    即使后续原始订阅链接失效,或订阅转换器后端失效,也无需重新配置该字段。
  • host:订阅转换器的后端地址。
    可以保持与baseUrl中的地址部分相同。后续订阅转换器失效,可仅修改host字段而无需修改baseUrl
  • url:代理服务商提供的原始订阅链接。
    即使原始订阅链接被和谐也无需修改。
    直到原始订阅连接失效,可仅修改url字段而无需修改baseUrl
  • filename:显示在代理服务中的配置文件名。

部署完成后,可以通过以下网址访问转换后的配置文件:

1
https://sub.<zone-id>.workers.dev?pwd=mypassword

并可以添加至主流的代理客户端。

建议绑定自定义域名访问:

1
https://sub.mydomain.com?pwd=mypassword

订阅转换器(Sub Converter)

订阅转换器接受一个订阅链接作为输入,可以对订阅进行定制修改,输出一个修改后的订阅链接。
Clash YAML配置也可以对订阅进行修改,但配置较为复杂。
建议使用订阅转换器,实现过滤广告节点、清理重复节点等功能。

订阅转换器

规则节点(Rule-Provider)

Clash Rule可以在同一个配置文件中定义不同应用的分流规则,如Steam走代理,同时Bilibili的流量直连不走代理。
规则节点用于添加动态订阅。

访问规则仓库查看所需的规则节点。

规则节点被定义在Clash YAML配置文件中,周期性自动更新。然而Github直链容易被和谐,所以需要套一层Github代理

1
2
3
4
5
6
7
8
9
10
rule-providers:
Steam:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Steam.yaml
interval: 86400
path: ./Steam.yml

rules:
- RULE-SET,Steam,🎮 游戏平台

NAS使用(TODO)

自用代理配置文件

clash.yaml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
mixed-port: 7890
allow-lan: true
log-level: info
mode: rule
# external-controller: '0.0.0.0:9090'
# external-ui: '/ui/'

proxies:
- name: 回家节点
type: ss
server: vpn4.mydomain.com
port: 12000
cipher: aes-128-gcm
password: mypassword
- name: 网易音乐解锁节点
type: http
server: mydomain.com
port: 16380

proxy-groups:

- name: 🚀 节点选择
type: select
proxies:
- 🚀 节点选择-代理
- DIRECT
- name: 🚀 节点选择-代理
type: select
proxies:
- ♻️ 自动选择
- 🔯 故障转移
- 🔮 负载均衡
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换

- name: 🚀 手动切换
type: select
proxies:
- 🚀 手动切换-代理
- DIRECT
- name: 🚀 手动切换-代理
type: select
use:
- 节点订阅

- name: ♻️ 自动选择
type: select
proxies:
- ♻️ 自动选择-代理
- DIRECT
- name: ♻️ 自动选择-代理
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅

- name: 🔯 故障转移
type: select
proxies:
- 🔯 故障转移-代理
- DIRECT
- name: 🔯 故障转移-代理
type: fallback
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅

- name: 🔮 负载均衡
type: select
proxies:
- 🔮 负载均衡-代理
- DIRECT
- name: 🔮 负载均衡-代理
type: load-balance
strategy: round-robin
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅

- name: 🎯 全球直连
type: select
proxies:
- 🎯 全球直连-代理
- DIRECT
- name: 🎯 全球直连-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理

- name: 🎮 游戏平台
type: select
proxies:
- 🎮 游戏平台-代理
- DIRECT
- name: 🎮 游戏平台-代理
type: select
proxies:
- 🚀 节点选择-代理
- 🇺🇸 美国节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 📺 哔哩哔哩
type: select
proxies:
- 📺 哔哩哔哩-代理
- DIRECT
- name: 📺 哔哩哔哩-代理
type: select
proxies:
- 🎯 全球直连-代理
- 🇨🇳 台湾节点
- 🇭🇰 香港节点

- name: 🎶 网易音乐
type: select
proxies:
- 🎶 网易音乐-代理
- DIRECT
- 回家->网易音乐
- name: 🎶 网易音乐-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 网易音乐解锁节点

- name: 🌏 国内媒体
type: select
proxies:
- 🌏 国内媒体-代理
- DIRECT
- name: 🌏 国内媒体-代理
type: select
proxies:
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🚀 手动切换-代理

- name: 🌍 国外媒体
type: select
proxies:
- 🌍 国外媒体-代理
- DIRECT
- name: 🌍 国外媒体-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 📲 电报消息
type: select
proxies:
- 📲 电报消息-代理
- DIRECT
- name: 📲 电报消息-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇸🇬 新加坡节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 📹 油管视频
type: select
proxies:
- 📹 油管视频-代理
- DIRECT
- name: 📹 油管视频-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇸🇬 新加坡节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 🎥 奈飞视频
type: select
proxies:
- 🎥 奈飞视频-代理
- DIRECT
- name: 🎥 奈飞视频-代理
type: select
proxies:
- 🎥 奈飞节点
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇸🇬 新加坡节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 🚀 ChatGPT
type: select
proxies:
- 🚀 ChatGPT-代理
- DIRECT
- name: 🚀 ChatGPT-代理
type: select
proxies:
- ChatGPT节点
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇸🇬 新加坡节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 📢 谷歌FCM
type: select
proxies:
- 📢 谷歌FCM-代理
- DIRECT
- name: 📢 谷歌FCM-代理
type: select
proxies:
- 🚀 节点选择-代理
- 🇺🇸 美国节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: Ⓜ️ 微软云盘
type: select
proxies:
- Ⓜ️ 微软云盘-代理
- DIRECT
- name: Ⓜ️ 微软云盘-代理
type: select
proxies:
- 🚀 节点选择-代理
- 🇺🇸 美国节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: Ⓜ️ 微软服务
type: select
proxies:
- Ⓜ️ 微软服务-代理
- DIRECT
- name: Ⓜ️ 微软服务-代理
type: select
proxies:
- 🚀 节点选择-代理
- 🇺🇸 美国节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 🍎 苹果服务
type: select
proxies:
- 🍎 苹果服务-代理
- DIRECT
- name: 🍎 苹果服务-代理
type: select
proxies:
- 🚀 节点选择-代理
- 🇺🇸 美国节点
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 🛑 广告拦截
type: select
proxies:
- REJECT
- DIRECT
- name: 🍃 应用净化
type: select
proxies:
- REJECT
- DIRECT

- name: 🐟 漏网之鱼
type: select
proxies:
- 🐟 漏网之鱼-代理
- DIRECT
- name: 🐟 漏网之鱼-代理
type: select
proxies:
- 🚀 节点选择-代理
- ♻️ 自动选择-代理
- 🇭🇰 香港节点
- 🇨🇳 台湾节点
- 🇸🇬 新加坡节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🇰🇷 韩国节点
- 🚀 手动切换-代理

- name: 回家
type: select
proxies:
- 回家节点
- DIRECT
- name: PT
type: select
proxies:
- 回家
- 回家节点
- DIRECT

- filter: "港|\U0001F1ED\U0001F1F0|HK|(?i)Hong"
name: 🇭🇰 香港节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "台|\U0001F1E8\U0001F1F3|\U0001F1F9\U0001F1FC|湾|TW|(?i)Taiwan"
name: 🇨🇳 台湾节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "新加坡|坡|狮城|\U0001F1F8\U0001F1EC|SG|(?i)Singapore"
name: 🇸🇬 新加坡节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "日|\U0001F1EF\U0001F1F5|东京|JP|(?i)Japan"
name: 🇯🇵 日本节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "韩国"
name: 🇰🇷 韩国节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "美|\U0001F1FA\U0001F1F2|US|(?i)States|American"
name: 🇺🇸 美国节点
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use:
- 节点订阅
- filter: "奈飞"
name: 🎥 奈飞节点
type: select
use:
- 节点订阅
- filter: "ChatGPT"
name: ChatGPT节点
type: select
use:
- 节点订阅
- name: 回家->网易音乐
type: relay
proxies:
- 回家节点
- 🎶 网易音乐-代理

rule-providers:
LocalAreaNetwork:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/LocalAreaNetwork.yaml
interval: 86400
path: ./LocalAreaNetwork.yml
UnBan:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/UnBan.yaml
interval: 86400
path: ./UnBan.yml
BanAD:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/BanAD.yaml
interval: 86400
path: ./BanAD.yml
BanProgramAD:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/BanProgramAD.yaml
interval: 86400
path: ./BanProgramAD.yml
GoogleFCM:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/GoogleFCM.yaml
interval: 86400
path: ./GoogleFCM.yml
GoogleCN:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/GoogleCN.yaml
interval: 86400
path: ./GoogleCN.yml
SteamCN:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/SteamCN.yaml
interval: 86400
path: ./SteamCN.yml
Tencent:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Tencent.yaml
interval: 86400
path: ./Tencent.yml
OneDrive:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/OneDrive.yaml
interval: 86400
path: ./OneDrive.yml
Microsoft:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Microsoft.yaml
interval: 86400
path: ./Microsoft.yml
Apple:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Apple.yaml
interval: 86400
path: ./Apple.yml
Telegram:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Telegram.yaml
interval: 86400
path: ./Telegram.yml
NetEaseMusic:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/NetEaseMusic.yaml
interval: 86400
path: ./NetEaseMusic.yml
Epic:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Epic.yaml
interval: 86400
path: ./Epic.yml
Origin:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Origin.yaml
interval: 86400
path: ./Origin.yml
Sony:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Sony.yaml
interval: 86400
path: ./Sony.yml
Steam:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Steam.yaml
interval: 86400
path: ./Steam.yml
Nintendo:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Nintendo.yaml
interval: 86400
path: ./Nintendo.yml
YouTube:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/YouTube.yaml
interval: 86400
path: ./YouTube.yml
Netflix:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Netflix.yaml
interval: 86400
path: ./Netflix.yml
BilibiliHMT:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/BilibiliHMT.yaml
interval: 86400
path: ./BilibiliHMT.yml
Bilibili:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/Bilibili.yaml
interval: 86400
path: ./Bilibili.yml
OpenAi:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/OpenAi.yaml
interval: 86400
path: ./OpenAi.yml
ChinaMedia:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/ChinaMedia.yaml
interval: 86400
path: ./ChinaMedia.yml
ProxyMedia:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/ProxyMedia.yaml
interval: 86400
path: ./ProxyMedia.yml
ProxyGFWlist:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/ProxyGFWlist.yaml
interval: 86400
path: ./ProxyGFWlist.yml
ChinaDomain:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/ChinaDomain.yaml
interval: 86400
path: ./ChinaDomain.yml
ChinaCompanyIp:
behavior: ipcidr
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/ChinaCompanyIp.yaml
interval: 86400
path: ./ChinaCompanyIp.yml
Download:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Download.yaml
interval: 86400
path: ./Download.yml
PrivateTracker:
behavior: classical
type: http
url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Providers/Ruleset/PrivateTracker.yaml
interval: 86400
path: ./PrivateTracker.yml

rules:
- DOMAIN-SUFFIX,sub.mydomain.com,DIRECT
- DOMAIN-SUFFIX,cfg.mydomain.com,DIRECT
- DOMAIN-SUFFIX,mydomain.com,回家
- RULE-SET,LocalAreaNetwork,🎯 全球直连
- RULE-SET,PrivateTracker,PT
- RULE-SET,NetEaseMusic,🎶 网易音乐
- RULE-SET,Tencent,DIRECT
- RULE-SET,UnBan,🎯 全球直连
- RULE-SET,BanAD,🛑 广告拦截
- RULE-SET,BanProgramAD,🍃 应用净化
- RULE-SET,GoogleFCM,📢 谷歌FCM
- RULE-SET,GoogleCN,🎯 全球直连
- RULE-SET,SteamCN,🎯 全球直连
- RULE-SET,OneDrive,Ⓜ️ 微软云盘
- RULE-SET,Microsoft,Ⓜ️ 微软云盘
- RULE-SET,Apple,🍎 苹果服务
- RULE-SET,Telegram,📲 电报消息
- RULE-SET,Epic,🎮 游戏平台
- RULE-SET,Origin,🎮 游戏平台
- RULE-SET,Sony,🎮 游戏平台
- RULE-SET,Steam,🎮 游戏平台
- RULE-SET,Nintendo,🎮 游戏平台
- RULE-SET,YouTube,📹 油管视频
- RULE-SET,Netflix,🎥 奈飞视频
- RULE-SET,BilibiliHMT,📺 哔哩哔哩
- RULE-SET,Bilibili,📺 哔哩哔哩
- RULE-SET,OpenAi,🚀 ChatGPT
- RULE-SET,ChinaMedia,🌏 国内媒体
- RULE-SET,ProxyMedia,🌍 国外媒体
- RULE-SET,ProxyGFWlist,🚀 节点选择
- RULE-SET,ChinaDomain,🎯 全球直连
- RULE-SET,ChinaCompanyIp,🎯 全球直连
- RULE-SET,Download,🎯 全球直连
- GEOIP,CN,🎯 全球直连
- MATCH,🚀 节点选择

proxy-providers:
节点订阅:
interval: 600
type: http
url: https://sub.mydomain.com?pwd=mypassword
filter: '^(?!.*(?:剩余流量|套餐到期|群|推荐))'
path: ./jiediandingyue.yml

subscribe-url: https://sub.mydomain.com?pwd=mypassword

注意这里的

1
filter: '^(?!.*(?:剩余流量|套餐到期|群|推荐))'

是使用正向正则匹配来反向过滤掉包含了特定字符的节点,起到类似于exclude-filter的作用。这种过滤方式比在订阅转换器上配置更方便一些。

TODO

  1. 注意安全问题
  2. NAS上缺少可以云同步配置文件的可视化工具,需要手动同步
  3. YACD无法对部分协议测速
  4. 支持Android,未测试

  1. 1.What is a GitHub gist?