-
Notifications
You must be signed in to change notification settings - Fork 2
/
ClashXKindly.yaml
287 lines (266 loc) · 10.3 KB
/
ClashXKindly.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
# --------------------------------ClashX Kindly Config-----------------------------------------------
# @GitHub https://github.com/LittlePonyX/ClashXKindly-config
# @Version 1.0.1
# @rules https://github.com/Loyalsoldier/clash-rules
# @rules https://github.com/blackmatrix7/ios_rule_script
# --------------------------------ClashX Kindly Config-----------------------------------------------
# mixed-port HTTP(S) and SOCKS5 使用同一端口7890
mixed-port: 7890
# 规则模式 rule(规则) / global(全局代理)/ direct(全局直连)
mode: rule
# 允许局域网的连接 用于局域网内共享代理
allow-lan: true
# 5 个级别 silent / info / warning / error / debug
log-level: info
# RESTful API for clash 使用 0.0.0.0 时请务必设定口令以保证安全
external-controller: 127.0.0.1:9090
secret: "ytYJ42g92tjU@!%z"
# DNS 服务器配置 按需启用 若不配置程序内置的 DNS 服务会被关闭
dns:
enable: false # 无特殊需求不建议启用
listen: 0.0.0.0:53
# 增强模式 fake-ip 或 redir-host(已不建议使用)
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
# 以下列表的域名将不会被解析为 fake ip 这些域名相关的解析请求将会返回它们真实的 IP 地址
# 详细参见 https://github.com/Hackl0us/SS-Rule-Snippet/blob/master/LAZY_RULES/Clash_Premium.yaml
fake-ip-filter:
- "*.lan"
- time.*.com
- time.*.gov
- time.*.edu.cn
- time.*.apple.com
- ntp.*.com
- "*.ntp.org.cn"
- "+.pool.ntp.org"
- localhost.ptlogin2.qq.com
- "music.163.com"
- "*.music.163.com"
- +.srv.nintendo.net
- +.stun.playstation.net
- +.msftconnecttest.com
- +.msftncsi.com
- +.xboxlive.com
- "*.blzstatic.cn"
- "*.mcdn.bilivideo.cn"
- "*.localhost"
# 所有 DNS 请求将会直接发送到服务器 不经过任何代理
nameserver: [223.5.5.5, 119.29.29.29]
# 当 fallback 参数被配置时 DNS 请求将同时发送至上方 nameserver 列表和下方 fallback 列表中配置的所有 DNS 服务器
# 当解析得到的 IP 地址的地理位置不是 CN 时 clash 将会选用 fallback 中 DNS 服务器的解析结果
fallback: ['tls://1.0.0.1', 'tls://8.8.4.4', 'https://cloudflare-dns.com/dns-query', 'https://dns.google/dns-query']
# 这些参数是为了对抗DNS投毒 建议在 DNS 投毒严重时启用
fallback-filter: { geoip: true, geoip-code: CN, ipcidr: [240.0.0.0/4, 0.0.0.0/32] }
# proxy-providers参数锚点 方便多订阅源复用
pvd-info: &pvd-info # 更新订阅周期 3天
interval: 259200
# 节点状态检查
health-check:
enable: true
url: http://www.gstatic.com/generate_204
interval: 600
# clash 链接无须转换 节点订阅转换 https://sub.xeton.dev/sub?target=clash&url=订阅链接多个用|分割&list=true&udp=false
# 可选自建或其他订阅转换工具 推荐选择输出为 NodeList 也可处理节点过滤
proxy-providers:
Subscribe:
# 代理提供商类型 http|file
type: http
# 引用参数锚点
<<: *pvd-info
# 排除关键字使用exclude参数(UrlCode编码)例如要排除"海外|到期"在链接后追加 &exclude=%E6%B5%B7%E5%A4%96%7C%E5%88%B0%E6%9C%9F
url: https://sub.xeton.dev/sub?target=clash&url=订阅链接多个用|分割&list=true&udp=false&exclude=%E6%B5%B7%E5%A4%96%7C%E5%88%B0%E6%9C%9F
# 订阅内容保存路径
path: ./Providers/Proxies/Subscribe.yaml
# filter: 'HK|TW|US' # 过滤节点 Golang regex不支持复杂表达式 建议用订阅转换工具过滤
# ======== 引用当前已有clash配置文件示例 ========
# MyConfig:
# type: file
# path: MyConfig.yaml # 当前已有配置文件path
# health-check:
# enable: true
# interval: 36000
# url: http://www.gstatic.com/generate_204
# filter: 'HK|JP|VN|SG'
# 定义节点过滤参数锚点
filter-info: &filter-info
type: file
path: ./Providers/Proxies/Subscribe.yaml
# 代理组中不支持 filter 在这处理
HK-Node: { <<: *filter-info, filter: "港|HK|(?i)Hong" }
TW-Node: { <<: *filter-info, filter: "台|湾|TW|(?i)Taiwan" }
JP-Node: { <<: *filter-info, filter: "日|东京|JP|(?i)Japan" }
SG-Node: { <<: *filter-info, filter: "新|坡|獅|SG|(?i)Singapore" }
US-Node: { <<: *filter-info, filter: "美|US|(?i)States|American" }
# 使用proxy-providers中的节点 定义锚点
all-proxy: &all-proxy
type: select
use:
- Subscribe # 引用订阅文件
# - MyConfig # 引用已有配置文件
# 其他代理 自建等写在这里
proxies:
- { name: "ss1", type: ss, server: server, port: 443, cipher: chacha20-ietf-poly1305, password: "password", udp: true}
# - { name: "ss2", type: ss, server: server, port: 443, cipher: chacha20-ietf-poly1305, password: "password", udp: true}
# 定义自建代理锚点
local-proxy: &local-proxy
- ss1
# - ss2
# 定义自动测速节点
auto: &auto-select
type: url-test
lazy: true
url: http://www.gstatic.com/generate_204
# 节点检测 间隔10分钟
interval: 600
use:
- Subscribe
# - MyConfig # 引用已有配置文件
# 定义分流参数锚点
group-proxy: &group-proxy
type: select
proxies: [🚀 手动切换, ♻️ 自动选择, 🇭🇰 香港节点, 🇨🇳 台湾节点, 🇯🇵 日本节点, 🇸🇬 狮城节点, 🇺🇲 美国节点, DIRECT]
# 定义代理分组 与锚点合并
proxy-groups:
- name: 🚀 手动切换
<<: *all-proxy
proxies:
- ♻️ 自动选择
# - 🔧 自定节点 # 按需是否使用自定义节点
- name: ♻️ 自动选择
<<: *auto-select
proxies:
# 添加自定义节点
# - ss1
# - ss2
- name: 🌍 国外媒体
type: select
<<: *group-proxy
proxies: [🚀 手动切换, DIRECT]
- name: 🍎 苹果服务
<<: *group-proxy
- name: 📺 哔哩哔哩
type: select
proxies: [DIRECT, 🇭🇰 香港节点, 🇨🇳 台湾节点]
- name: 🤖 OpenAi
type: select
proxies: [🚀 手动切换, 🇺🇲 美国节点, 🇯🇵 日本节点]
# - name: 🆎 AdBlock # 广告过滤分组 已用其他过滤工具不建议Clash中再启用
# type: select
# proxies: [REJECT, DIRECT]
# 代理转发链 relay 示例 新版本推荐使用更快速的 tunnels 模式
# proxies 中不应该包含 relay 节点 不支持 UDP
# 流量示意 clash <-> vmess <-> ss1 <-> 互联网 (这样是为了用自建节点落地解决机场跳 IP 问题)
# - name: 🔁 relay
# type: relay
# proxies: # !!!注意proxies中不能有relay节点
# - vmess
# - ss1
- name: 🔧 自定节点
type: select
proxies: *local-proxy
- name: 🐟 漏网之鱼
<<: *group-proxy
# Meta 核心节点按地区分组示例 (Clash Premium 不支持此种过滤)
# - name: 🇭🇰 香港节点
# <<: *all-proxy
# filter: '港|HK|(?i)Hong'
# - name: 🇨🇳 台湾节点
# <<: *all-proxy
# filter: '台|湾|TW|(?i)Taiwan'
# 节点按地区分组 当前手动选择节点 可参考auto-select锚点改为自动选择
- name: 🇭🇰 香港节点
type: select
use:
- HK-Node
- name: 🇨🇳 台湾节点
type: select
use:
- TW-Node
- name: 🇯🇵 日本节点
type: select
use:
- JP-Node
- name: 🇸🇬 狮城节点
type: select
use:
- SG-Node
- name: 🇺🇲 美国节点
type: select
use:
- US-Node
# 定义规则集参数锚点 interval 3 天更新一次足够 Meta 核心不需要 type 和 path 参数
rule-info: &rule-info
type: http
interval: 259200
# classical 不推荐使用 复杂度较高不建议添加太多
classical: &rule-classical
behavior: classical
<<: *rule-info
# domain or ipcidr 推荐使用 匹配更高效
domain: &rule-domain
behavior: domain
<<: *rule-info
# 引用规则集
rule-providers:
Apple:
<<: *rule-domain
url: https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt
path: ./Providers/Ruleset/Apple.yaml
iCloud:
<<: *rule-domain
url: https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt
path: ./Providers/Ruleset/iCloud.yaml
Private:
<<: *rule-domain
url: https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt
path: ./Providers/Ruleset/Private.yaml
Proxy:
<<: *rule-domain
url: https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt
path: ./Providers/Ruleset/Proxy.yaml
GFWList:
<<: *rule-domain
url: https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt
path: ./Providers/Ruleset/GFWList.yaml
BiliBili:
<<: *rule-classical
url: https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/BiliBili/BiliBili.yaml
path: ./Providers/Ruleset/BiliBili.yaml
GlobalMedia:
<<: *rule-classical
url: https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/GlobalMedia/GlobalMedia.yaml
path: ./Providers/Ruleset/GlobalMedia.yaml
# Ad: # anti-AD的广告过滤 按需启用
# <<: *rule-domain
# url: https://anti-ad.net/clash.yaml
# path: ./Providers/Ruleset/anti-ad-clash.yaml
# 自定义规则
rules:
- GEOIP,LAN,DIRECT # LAN 使用直连
- GEOIP,CN,DIRECT # CN 使用直连
- RULE-SET,Apple,🍎 苹果服务
- RULE-SET,iCloud,🍎 苹果服务
- RULE-SET,BiliBili,📺 哔哩哔哩
- RULE-SET,GlobalMedia,🌍 国外媒体
- RULE-SET,Proxy,🚀 手动切换
- RULE-SET,Private,DIRECT
# - RULE-SET,Ad,🆎 AdBlock # 广告过滤 按需启用
# ========其他自定义规则示例========
- DOMAIN-SUFFIX,ai.com,🤖 OpenAi # 域名后缀匹配 使用代理组
- DOMAIN-SUFFIX,openai.com,🤖 OpenAi
- DOMAIN-SUFFIX,identrust.com,🤖 OpenAi
- IP-CIDR,162.159.193.0/24,DIRECT # IP 段匹配 Cloudflare
- IP-CIDR,91.108.0.0/16,🚀 手动切换,no-resolve
- IP-CIDR,109.239.140.0/24,🚀 手动切换,no-resolve
- DOMAIN-KEYWORD,-cn,DIRECT
- DOMAIN-SUFFIX,local,DIRECT
- DOMAIN-SUFFIX,cn,DIRECT
- DOMAIN-SUFFIX,umeng.co,REJECT # REJECT 广告拦截
- DOMAIN-SUFFIX,umeng.com,REJECT
- DOMAIN-SUFFIX,umtrack.com,REJECT
- DOMAIN-SUFFIX,ad.xiaomi.com,REJECT
- DOMAIN-SUFFIX,ad1.xiaomi.com,REJECT
# 上面规则都未命中
- MATCH,🐟 漏网之鱼 # 使用漏网之鱼分组 可以理解为黑名单模式
# - MATCH, DIRECT # 使用直连 即白名单模式 配合下方GFWList效果更佳
# - RULE-SET,GFWList,🚀 手动切换