-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmihomo_smart.yaml
More file actions
258 lines (252 loc) · 16.1 KB
/
mihomo_smart.yaml
File metadata and controls
258 lines (252 loc) · 16.1 KB
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
# update: 2026-04-29
# 简介: https://github.com/echs-top/proxy
# 节点IP优先级:ip-version: ipv6-prefer
# 测速细分/筛选:https://8.8.8.8/generate_204、https://[2001:4860:4860::8888]/generate_204
providers: &providers { type: http, interval: 86400, proxy: 直接连接, header: { User-Agent: ["clash-verge/v2.4.7"] }, health-check: { enable: true, url: 'https://dns.google/generate_204', expected-status: 204, interval: 900, timeout: 3000, max-failed-times: 2, lazy: false }, override: { ip-version: dual }, exclude-filter: '(?i)套餐|剩余|流量|到期|重置|频道|订阅|官网|禁止|客户端|有效|联系|测试|节点|日期|群组|加入|通知|维护|网址|地址|下载|更新|APP|登录|严禁|海外|恢复|处理|谢谢' }
proxy-providers:
link1: { <<: *providers, url: '订阅链接1', path: ./providers/link1.yaml }
link2: { <<: *providers, url: '订阅链接2', path: ./providers/link2.yaml }
link3: { <<: *providers, url: '订阅链接3', path: ./providers/link3.yaml }
# 策略分组
use: &use { use: [link1,link2] }
ipv6: true
allow-lan: false
bind-address: '*'
mode: rule
log-level: error
unified-delay: true
tcp-concurrent: true
# YAML1.1特殊修正
find-process-mode: 'off'
disable-keep-alive: false
keep-alive-interval: 15
keep-alive-idle: 300
etag-support: true
# global-ua: 'Mozilla/5.0 (Linux; Android 16; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.7727.55 Mobile Safari/537.36'
# global-ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.7680.201 Safari/537.36'
# external-controller: 127.0.0.1:9090
# secret: '密码'
# external-ui: ./zashboard
# external-ui-url: 'https://github.com/Zephyruso/zashboard/releases/latest/download/dist.zip'
# geodata-loader: standard
# geo-auto-update: true
# geo-update-interval: 72
# geox-url: { asn: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb" }
lgbm-auto-update: true
lgbm-update-interval: 72
lgbm-url: 'https://github.com/vernesong/mihomo/releases/download/LightGBM-Model/Model-large.bin'
profile: { store-selected: true, store-fake-ip: true, smart-collector-size: 100 }
# experimental: { quic-go-disable-gso: true, quic-go-disable-ecn: true, dialer-ip4p-convert: false }
port: 0
socks-port: 0
mixed-port: 0
tproxy-port: 0
redir-port: 0
# authentication: ["用户:密码"]
tun:
enable: true
# device: meta
# Windows mixed, Android15+ gvisor(抗休眠)
stack: mixed
auto-route: true
auto-redirect: true
auto-detect-interface: true
strict-route: true
disable-icmp-forwarding: true
dns-hijack: [any:53,tcp://any:53]
# mtu: 9000
# udp-timeout: 300
# endpoint-independent-nat: true
ip: &ip { type: http, interval: 86400, proxy: 代理连接, behavior: ipcidr, format: mrs }
domain: &domain { type: http, interval: 86400, proxy: 代理连接, behavior: domain, format: mrs }
rule-providers:
private_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/private_ip.mrs', path: ./rules/private_ip.mrs }
private: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/private.mrs', path: ./rules/private.mrs }
AWAvenue-Ads: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/AWAvenue-Ads_domain.mrs', path: ./rules/AWAvenue-Ads.mrs }
fcm: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/googlefcm.mrs', path: ./rules/fcm.mrs }
captcha: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/captcha_domain.mrs', path: ./rules/captcha.mrs }
ai: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/ai.mrs', path: ./rules/ai.mrs }
telegram: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/telegram.mrs', path: ./rules/telegram.mrs }
media: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/media.mrs', path: ./rules/media.mrs }
google-cn: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/google-cn_domain.mrs', path: ./rules/google-cn.mrs }
google: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/google.mrs', path: ./rules/google.mrs }
trackerslist: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/trackerslist.mrs', path: ./rules/trackerslist.mrs }
apple-cn: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/apple-cn.mrs', path: ./rules/apple-cn.mrs }
microsoft-cn: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/microsoft-cn.mrs', path: ./rules/microsoft-cn.mrs }
games-cn: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/games-cn.mrs', path: ./rules/games-cn.mrs }
proxy_domain: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/proxy_domain.mrs', path: ./rules/proxy_domain.mrs }
direct_domain: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/direct_domain.mrs', path: ./rules/direct_domain.mrs }
github: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/github.mrs', path: ./rules/github.mrs }
proxy: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/proxy.mrs', path: ./rules/proxy.mrs }
cn: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/cn_domain.mrs', path: ./rules/cn.mrs }
dnsmasq-china-add: { <<: *domain, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/dnsmasq-china-add_domain.mrs', path: ./rules/dnsmasq-china-add.mrs }
telegram_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/telegram_ip.mrs', path: ./rules/telegram_ip.mrs }
media_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/media_ip.mrs', path: ./rules/media_ip.mrs }
google_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/google_ip.mrs', path: ./rules/google_ip.mrs }
proxy_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/proxy_ip.mrs', path: ./rules/proxy_ip.mrs }
enhanced-FaaS-in-China_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/enhanced-FaaS-in-China_ip.mrs', path: ./rules/enhanced-FaaS-in-China_ip.mrs }
direct_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/direct_ip.mrs', path: ./rules/direct_ip.mrs }
cn_ip: { <<: *ip, url: 'https://raw.githubusercontent.com/echs-top/proxy/main/rules/mrs/cn_ip.mrs', path: ./rules/cn_ip.mrs }
rules:
- SUB-RULE,(DST-PORT,5228-5230),fcm_rules
- DST-PORT,1337/2710/6881-6999/7777,TRACKER
- RULE-SET,private_ip,直接连接,no-resolve
- RULE-SET,private,直接连接
- RULE-SET,AWAvenue-Ads,REJECT
- SUB-RULE,(RULE-SET,fcm),fcm_rules
- SUB-RULE,(RULE-SET,captcha),captcha_rules
- SUB-RULE,(RULE-SET,ai),ai_rules
- SUB-RULE,(RULE-SET,telegram),telegram_rules
- SUB-RULE,(RULE-SET,media),media_rules
- RULE-SET,google-cn,直接连接
- SUB-RULE,(RULE-SET,google),google_rules
- SUB-RULE,(RULE-SET,trackerslist),trackerslist_rules
- RULE-SET,apple-cn,直接连接
- RULE-SET,microsoft-cn,直接连接
- RULE-SET,games-cn,直接连接
- SUB-RULE,(RULE-SET,proxy_domain),proxy_rules
- RULE-SET,direct_domain,直接连接
- SUB-RULE,(RULE-SET,github),proxy_rules
- SUB-RULE,(RULE-SET,proxy),proxy_rules
- RULE-SET,cn,直接连接
- SUB-RULE,(RULE-SET,telegram_ip),telegram_rules
- SUB-RULE,(RULE-SET,media_ip),media_rules
- SUB-RULE,(RULE-SET,google_ip),google_rules
- SUB-RULE,(RULE-SET,proxy_ip),proxy_rules
- RULE-SET,enhanced-FaaS-in-China_ip,直接连接
- RULE-SET,direct_ip,直接连接
- RULE-SET,cn_ip,直接连接
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
# 极其激进的bt/tracker兜底
- DST-PORT,10000-65535,TRACKER
- MATCH,代理连接
sub-rules:
fcm_rules:
- NETWORK,UDP,REJECT
- MATCH,直接连接
captcha_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,人机验证
ai_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,国外AI
telegram_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,TELEGRAM
media_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,国外媒体
google_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,GOOGLE
trackerslist_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,TRACKER
proxy_rules:
- AND,((NETWORK,UDP),(DST-PORT,443)),代理QUIC
- MATCH,代理连接
hosts:
dns.alidns.com: [223.5.5.5,223.6.6.6,'2400:3200::1','2400:3200:baba::1']
doh.pub: [120.53.53.53,1.12.12.21]
dns.google: [8.8.8.8,8.8.4.4,'2001:4860:4860::8888','2001:4860:4860::8844']
dns.quad9.net: [9.9.9.9,149.112.112.112,'2620:fe::fe','2620:fe::9']
services.googleapis.cn: services.googleapis.com
google.cn: google.com
direct-dns: &direct-dns [119.29.29.29,223.5.5.5,'2402:4e00::','2400:3200::1']
direct-doh: &direct-doh ['https://dns.alidns.com/dns-query#直接连接','https://doh.pub/dns-query#直接连接&h3=false']
proxy-doh: &proxy-doh ['https://dns.google/dns-query#代理DNS','https://dns.quad9.net/dns-query#代理DNS']
dns:
enable: true
cache-algorithm: arc
ipv6: true
prefer-h3: true
use-hosts: true
use-system-hosts: false
respect-rules: false
# listen: 0.0.0.0:1053
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-range6: fd00:bada:55ed::1/64
# fake-ip-ttl: 1
fake-ip-filter-mode: rule
fake-ip-filter:
- RULE-SET,private,real-ip
- RULE-SET,AWAvenue-Ads,fake-ip
- RULE-SET,fcm,real-ip
- RULE-SET,captcha,fake-ip
- RULE-SET,ai,fake-ip
- RULE-SET,telegram,fake-ip
- RULE-SET,media,fake-ip
- RULE-SET,google-cn,real-ip
- RULE-SET,google,fake-ip
- RULE-SET,trackerslist,fake-ip
- RULE-SET,apple-cn,real-ip
- RULE-SET,microsoft-cn,real-ip
- RULE-SET,games-cn,real-ip
- RULE-SET,proxy_domain,fake-ip
- RULE-SET,direct_domain,real-ip
- RULE-SET,github,fake-ip
- RULE-SET,proxy,fake-ip
- RULE-SET,cn,real-ip
- MATCH,fake-ip
# default-nameserver: [223.5.5.5,119.29.29.29]
proxy-server-nameserver: *direct-doh
nameserver-policy:
'rule-set:private': *direct-dns
'rule-set:AWAvenue-Ads': [rcode://name_error]
'rule-set:fcm': *direct-doh
'rule-set:captcha': *direct-doh
'rule-set:ai': *proxy-doh
'rule-set:telegram': *proxy-doh
'rule-set:media': *proxy-doh
'rule-set:google-cn': *direct-doh
'rule-set:google': *proxy-doh
'rule-set:trackerslist': *proxy-doh
'rule-set:apple-cn': *direct-doh
'rule-set:microsoft-cn': *direct-doh
'rule-set:games-cn': *direct-doh
'rule-set:proxy_domain': *proxy-doh
'rule-set:direct_domain': *direct-doh
'rule-set:github': *proxy-doh
'rule-set:proxy': *proxy-doh
'rule-set:cn': *direct-dns
'rule-set:dnsmasq-china-add': *direct-dns
nameserver: *proxy-doh
direct-nameserver: *direct-doh
direct-nameserver-follow-policy: true
sniffer:
enable: true
force-dns-mapping: true
parse-pure-ip: true
override-destination: false
sniff: { HTTP: { ports: [80,8080-8880], override-destination: true }, TLS: { ports: [443,8443] }, QUIC: { ports: [443,8443] } }
skip-domain: ['rule-set:private','rule-set:AWAvenue-Ads','rule-set:fcm','rule-set:captcha','rule-set:ai','rule-set:telegram','rule-set:media','rule-set:google-cn','rule-set:google','rule-set:trackerslist','rule-set:apple-cn','rule-set:microsoft-cn','rule-set:games-cn','rule-set:proxy_domain','rule-set:direct_domain','rule-set:github','rule-set:proxy','rule-set:cn']
skip-src-address: ['rule-set:private_ip','rule-set:telegram_ip','rule-set:media_ip','rule-set:google_ip','rule-set:proxy_ip','rule-set:enhanced-FaaS-in-China_ip','rule-set:direct_ip','rule-set:cn_ip']
skip-dst-address: ['rule-set:private_ip']
proxies: [{ name: IPV4优先, type: direct, udp: true, ip-version: ipv4-prefer },{ name: IPV6优先, type: direct, udp: true, ip-version: ipv6-prefer },{ name: 仅IPV4, type: direct, udp: true, ip-version: ipv4 },{ name: 仅IPV6, type: direct, udp: true, ip-version: ipv6 }]
smart: &smart { type: smart, strategy: sticky-sessions, uselightgbm: true, collectdata: false, sample-rate: 1, prefer-asn: false, <<: *use, hidden: true }
dl: &dl { type: select, proxies: [代理连接,直接连接,最低延迟,香港|智能选择,台湾|智能选择,新加坡|智能选择,日本|智能选择,韩国|智能选择,美国|智能选择,加拿大|智能选择,德国|智能选择,英国|智能选择,法国|智能选择,荷兰|智能选择,PASS,REJECT], include-all-providers: true }
proxy-groups:
- { name: 代理连接, type: select, proxies: [最低延迟,香港|智能选择,台湾|智能选择,新加坡|智能选择,日本|智能选择,韩国|智能选择,美国|智能选择,加拿大|智能选择,德国|智能选择,英国|智能选择,法国|智能选择,荷兰|智能选择], include-all-providers: true, icon: 'https://mihomo.echs.top/img/icon/Global.webp' }
- { name: 直接连接, type: select, proxies: [DIRECT,IPV4优先,IPV6优先,仅IPV4,仅IPV6], icon: 'https://mihomo.echs.top/img/icon/DIRECT.webp' }
- { name: 代理QUIC, type: select, proxies: [PASS,REJECT], icon: 'https://mihomo.echs.top/img/icon/Forbidden.webp' }
- { name: 代理DNS, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/Server.webp' }
- { name: 人机验证, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/CloudFlare.webp' }
- { name: 国外AI, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/AI.webp' }
- { name: TELEGRAM, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/Telegram.webp' }
- { name: 国外媒体, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/Emby.webp' }
- { name: GOOGLE, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/Google.webp' }
- { name: TRACKER, <<: *dl, icon: 'https://mihomo.echs.top/img/icon/Download_2.webp' }
- { name: 最低延迟, type: url-test, tolerance: 30, <<: *use, hidden: true, icon: 'https://mihomo.echs.top/img/icon/Fast.webp' }
- { name: 香港|智能选择, <<: *smart, filter: '(?i)🇭🇰|香港|\bHK\b|\bhongkong\b|\bhong\s?kong\b', icon: 'https://mihomo.echs.top/img/flags/hk.svg' }
- { name: 台湾|智能选择, <<: *smart, filter: '(?i)🇹🇼|台湾|\bTW\b|\btaiwan\b', icon: 'https://mihomo.echs.top/img/flags/tw.svg' }
- { name: 新加坡|智能选择, <<: *smart, filter: '(?i)🇸🇬|新加坡|狮城|\bSG\b|\bsingapore\b', icon: 'https://mihomo.echs.top/img/flags/sg.svg' }
- { name: 日本|智能选择, <<: *smart, filter: '(?i)🇯🇵|日本|\bJP\b|\bjapan\b', icon: 'https://mihomo.echs.top/img/flags/jp.svg' }
- { name: 韩国|智能选择, <<: *smart, filter: '(?i)🇰🇷|韩国|\bKR\b', icon: 'https://mihomo.echs.top/img/flags/kr.svg' }
- { name: 美国|智能选择, <<: *smart, filter: '(?i)🇺🇸|美国|\bUS\b|\bunitedstates\b|\bunited\s?states\b', icon: 'https://mihomo.echs.top/img/flags/us.svg' }
- { name: 加拿大|智能选择, <<: *smart, filter: '(?i)🇨🇦|加拿大|\bCA\b|\bcanada\b', icon: 'https://mihomo.echs.top/img/flags/ca.svg' }
- { name: 德国|智能选择, <<: *smart, filter: '(?i)🇩🇪|德国|\bDE\b|\bgermany\b', icon: 'https://mihomo.echs.top/img/flags/de.svg' }
- { name: 英国|智能选择, <<: *smart, filter: '(?i)🇬🇧|英国|\bUK\b|\bGB\b|\bunitedkingdom\b|\bunited\s?kingdom\b', icon: 'https://mihomo.echs.top/img/flags/gb.svg' }
- { name: 法国|智能选择, <<: *smart, filter: '(?i)🇫🇷|法国|\bFR\b', icon: 'https://mihomo.echs.top/img/flags/fr.svg' }
- { name: 荷兰|智能选择, <<: *smart, filter: '(?i)🇳🇱|荷兰|\bNL\b|\bnetherlands?\b', icon: 'https://mihomo.echs.top/img/flags/nl.svg' }
- { name: GLOBAL, type: select, proxies: [最低延迟,香港|智能选择,台湾|智能选择,新加坡|智能选择,日本|智能选择,韩国|智能选择,美国|智能选择,加拿大|智能选择,德国|智能选择,英国|智能选择,法国|智能选择,荷兰|智能选择,代理连接,直接连接,代理QUIC,代理DNS,人机验证,国外AI,TELEGRAM,国外媒体,GOOGLE,TRACKER], include-all-providers: true, hidden: true, icon: 'https://mihomo.echs.top/img/icon/Globefish.webp' }