Sub-Store Clash/Mihomo文件配置模板

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
# 机场订阅,名称不能重复
proxy-providers:
Airport_01:
type: http
interval: 1800
health-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 300
proxy: 🟢 直连
override:
udp: true
url: "机场订阅链接|或者组合订阅链接"

# 用于下载订阅时指定UA
global-ua: clash.meta

# 全局配置
port: 7890
socks-port: 7891
redir-port: 7892
mixed-port: 7893
tproxy-port: 7894
ipv6: true
allow-lan: true
unified-delay: true
tcp-concurrent: true

geodata-mode: true
geodata-loader: standard
geo-auto-update: true
geo-update-interval: 48
geox-url:
geoip: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
geosite: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
mmdb: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb"
asn: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/GeoLite2-ASN.mmdb"

# 控制面板
external-controller: 0.0.0.0:9090
secret: "123456"
external-ui: ui
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

# 匹配进程 always/strict/off
find-process-mode: strict
global-client-fingerprint: chrome
keep-alive-idle: 300
keep-alive-interval: 15

# 策略组选择,是否记忆用户配置
profile:
store-selected: true

# 流量嗅探
sniffer:
enable: true
sniff:
HTTP:
ports: [80, 8080-8880]
override-destination: false
TLS:
ports: [443, 8443]
QUIC:
ports: [443]
force-domain:
- +.v2ex.com
skip-domain:
- "dlg.io.mi.com"
- "+.push.apple.com"
- "+.apple.com"
- "+.narwal.com"
- "+.midea.com"

# 代理模式
tun:
enable: true
stack: mixed
mtu: 9000
dns-hijack:
- "any:53"
- "tcp://any:53"
auto-route: true
auto-redirect: true
auto-detect-interface: true

# DNS模块
dns:
enable: true
listen: 0.0.0.0:1053
ipv6: true
respect-rules: true
# 模式切换 redir-host / fake-ip
enhanced-mode: redir-host
#cache: false # 禁用 DNS 缓存
default-nameserver:
- tls://223.5.5.5:853
- tls://1.12.12.12:853
nameserver:
- https://223.5.5.5/dns-query
- https://1.12.12.12/dns-query
proxy-server-nameserver:
- https://223.5.5.5/dns-query
- https://1.12.12.12/dns-query
nameserver-policy:
"rule-set:cn_domain,private_domain":
- https://223.5.5.5/dns-query
- https://1.12.12.12/dns-query
"tv.micu.hk,hxd.as174.de":
- https://223.5.5.5/dns-query
- https://1.12.12.12/dns-query
"rule-set:proxy,geolocation-!cn":
- "https://8.8.8.8/dns-query"
- "https://1.1.1.1/dns-query"
fallback:
- "https://8.8.8.8/dns-query"
- "https://1.1.1.1/dns-query"


proxies:
- name: "🟢 直连"
type: direct
udp: true

# 锚点
pr: &pr {type: select, proxies: [🌐 默认节点, ♻️ 自动选择, 🟢 直连]}

# 策略组
proxy-groups:
- {name: 🌐 默认节点, type: select, include-all: true, proxies: [♻️ 自动选择]}
- {name: 🌏 中国直连, type: select, include-all: true, filter: "^(?!🟢 直连$).*$", proxies: [🟢 直连, 🌐 默认节点]}
- {name: 🤖 ChatGPT, type: select, include-all: true, filter: "^(?!🟢 直连).*$", proxies: [🌐 默认节点]}
- {name: 📨 电报, type: select, include-all: true, filter: "^(?!🟢 直连).*$", proxies: [🌐 默认节点]}
- {name: 🎥 奈飞, type: select, include-all: true, filter: "^(?!🟢 直连).*$", proxies: [🌐 默认节点]}
- {name: 🎥 迪士尼, type: select, include-all: true, filter: "^(?!🟢 直连).*$", proxies: [🌐 默认节点]}
- {name: 🍎 Apple, type: select, include-all: true, filter: "^(?!🟢 直连$).*$", proxies: [🟢 直连, 🌐 默认节点]}
- {name: 🎵 TikTok, type: select, include-all: true, filter: "^(?!🟢 直连).*$", proxies: [🌐 默认节点]}
- {name: ♻️ 自动选择, type: url-test, include-all: true, tolerance: 20, interval: 300, filter: "^((?!(直连)).)*$"}
- {name: 🐟 漏网之鱼, type: select, include-all: true, proxies: [🌐 默认节点]}

# 规则集
rules:
# - RULE-SET,ads,REJECT # 阻止访问 ads 规则集
- DOMAIN-SUFFIX,baidu.com,🟢 直连 #指定域名直连
- RULE-SET,private_ip,🟢 直连
- RULE-SET,private_domain,🟢 直连
- RULE-SET,openai_domain,🤖 ChatGPT
- RULE-SET,gemini_domain,🤖 ChatGPT
- RULE-SET,claude_domain,🤖 ChatGPT
- RULE-SET,telegram_domain,📨 电报
- RULE-SET,netflix_domain,🎥 奈飞
- RULE-SET,disney_domain,🎥 迪士尼
- RULE-SET,tiktok_domain,🎵 TikTok
- RULE-SET,apple_domain,🍎 Apple
- RULE-SET,proxy,🌐 默认节点
- RULE-SET,geolocation-!cn,🌐 默认节点
- RULE-SET,cn_domain,🌏 中国直连
- RULE-SET,cn_ip,🌏 中国直连
- MATCH,🐟 漏网之鱼

rule-anchor:
ip: &ip {type: http, interval: 86400, behavior: ipcidr, format: mrs}
domain: &domain {type: http, interval: 86400, behavior: domain, format: mrs}
qcy: &qcy {type: http, interval: 86400, behavior: domain, format: text}
class: &class {type: http, interval: 86400, behavior: classical, format: text}

rule-providers:
private_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/private.mrs"}
proxy: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/proxy.mrs"}
openai_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/openai.mrs"}
gemini_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/google-gemini.mrs"}
claude_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/anthropic.mrs"}
apple_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/apple.mrs"}
tiktok_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/tiktok.mrs"}
netflix_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/netflix.mrs"}
disney_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/disney.mrs"}
cn_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/cn.mrs"}
geolocation-!cn: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/geolocation-!cn.mrs"}
ads: {!!merge <<: *domain, url: "https://github.com/DustinWin/ruleset_geodata/raw/refs/heads/mihomo-ruleset/ads.mrs"}
telegram_domain: {!!merge <<: *domain, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geosite/telegram.mrs"}

cn_ip: {!!merge <<: *ip, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geoip/cn.mrs"}
private_ip: {!!merge <<: *ip, url: "https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo-lite/geoip/private.mrs"}