Skip to content

Instantly share code, notes, and snippets.

@test482
Last active May 4, 2025 23:36
Show Gist options
  • Save test482/62439ebb2fdba846c0e3071d299eae91 to your computer and use it in GitHub Desktop.
Save test482/62439ebb2fdba846c0e3071d299eae91 to your computer and use it in GitHub Desktop.
Clash Meta config
# Meta JSON Schema: A linter and snippet provider for Clash.Meta(mihomo) configuration.
log-level: info
external-controller: 127.0.0.1:9090
# external-ui: /usr/share/metacubexd/
# secret: "在此修改访问令牌"
mode: rule
mixed-port: 7890
allow-lan: false
ipv6: false
unified-delay: false
tcp-concurrent: true
find-process-mode: strict
etag-support: true
hosts:
"services.googleapis.cn": "services.googleapis.com"
dns:
enable: true
enhanced-mode: fake-ip
default-nameserver:
- 223.5.5.5
- 119.29.29.29
- "[2400:3200::1]"
- "[2402:4e00::]"
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
fallback: []
fake-ip-filter:
- "*"
# rule-set 仅支持 behavior 为 domain/classical
- "rule-set:clash_fake_ip_filter"
- "rule-set:private"
use-hosts: true
use-system-hosts: true
tun:
enable: true
stack: mixed
dns-hijack:
- any:53
- tcp://any:53
auto-route: true
auto-redirect: true
auto-detect-interface: true
exclude-interface:
- tailscale0
profile:
store-fake-ip: true
store-selected: true
proxy-providers:
Subs:
type: http
path: ./providers/subs/Subs.yaml
url: https://替换成机场订阅链接.example
interval: 86400 # 一天
health-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 600
# Subs2:
# type: http
# path: ./providers/subs/Subs2.yaml
# url: 替换成机场2订阅链接
# interval: 86400 # 一天
# health-check:
# enable: true
# url: https://www.gstatic.com/generate_204
# interval: 600
######### 锚点 start #######
USE_SUBS: &USE_SUBS { use: [Subs] }
SELECTL_PROXIES:
&SELECTL_PROXIES {
type: select,
proxies:
[
代理节点,
🇭🇰香港节点,
低倍率节点,
🇹🇼台湾节点,
🇸🇬新加坡节点,
🇯🇵日本节点,
🇺🇸美国节点,
自动选择,
手动选择,
DIRECT,
],
}
URLTEST:
&URLTEST {
type: url-test,
url: https://www.gstatic.com/generate_204,
interval: 600,
tolerance: 50,
lazy: true,
}
######### 锚点 end #######
proxy-groups:
- name: 代理节点
type: select
proxies:
- Fallback
- 🇭🇰香港节点
- 低倍率节点
- 🇹🇼台湾节点
- 🇸🇬新加坡节点
- 🇯🇵日本节点
- 🇺🇸美国节点
- 自动选择
- 手动选择
- name: 自动选择
<<: [*URLTEST, *USE_SUBS]
- name: 手动选择
type: select
<<: *USE_SUBS
- name: Fallback
type: fallback
url: https://www.gstatic.com/generate_204
interval: 300
proxies:
- 低倍率节点
- 🇯🇵日本节点
- name: Final
type: select
proxies:
- DIRECT
- 代理节点
- 自动选择
- 手动选择
- name: 流媒体
<<: *SELECTL_PROXIES
- name: Telegram
<<: *SELECTL_PROXIES
- name: AI
<<: *SELECTL_PROXIES
- name: TikTok
<<: *SELECTL_PROXIES
- name: Steam
<<: *SELECTL_PROXIES
- name: Apple
<<: *SELECTL_PROXIES
- name: Microsoft
<<: *SELECTL_PROXIES
- name: Custom Games
<<: *SELECTL_PROXIES
- name: 🇭🇰香港节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)HK|香港|Hong Kong|港专线)
exclude-filter: 倍率\:0\.|倍率\:1\]
- name: 低倍率节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)HK|香港|Hong Kong)
exclude-filter: 倍率\:1\.|倍率\:2\.
- name: 🇹🇼台湾节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)TW|台湾|Taiwan)
- name: 🇸🇬新加坡节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)SG|新加坡|Singapore)
- name: 🇯🇵日本节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)JP|日本|Japan)
- name: 🇺🇸美国节点
<<: [*URLTEST, *USE_SUBS]
filter: ((?i)US|美国|United States)
- name: 广告域名
type: select
proxies:
- REJECT
- DIRECT
- PASS
rules:
- RULE-SET,applications,DIRECT # 需要直连的常见软件列表
- RULE-SET,steamcn,DIRECT
- RULE-SET,custom-direct,DIRECT
- RULE-SET,private,DIRECT # 私有网络专用域名列表
- RULE-SET,jingdong,DIRECT # 京东直连,避免 app 图片加载缓慢
- RULE-SET,reject,广告域名
#
- RULE-SET,telegram_non_ip,Telegram
- RULE-SET,telegram_ip,Telegram
- RULE-SET,steam,Steam
- RULE-SET,ai_non_ip,AI # 包含 OpenAI、Google Gemini、Claude、Perplexity 等
- RULE-SET,apple_services,Apple
- RULE-SET,apple_cdn,DIRECT # 包含 Apple, Inc. 在中华人民共和国完成工信部 ICP 备案和公安网备、且在中华人民共和国境内提供 HTTP 服务的域名
- RULE-SET,apple_cn_non_ip,DIRECT # 云上贵州(icloud.com.cn)和 苹果地图大陆特供版 等服务的域名
- RULE-SET,microsoft_non_ip,Microsoft
- RULE-SET,microsoft_cdn_non_ip,DIRECT # 包含 Microsoft 在中华人民共和国完成工信部 ICP 备案和公安网备、且在中华人民共和国境内提供 HTTP 服务的域名
- RULE-SET,custom-proxy,代理节点
- RULE-SET,tiktok,TikTok
- RULE-SET,stream_non_ip,流媒体
- RULE-SET,stream_ip,流媒体
- RULE-SET,custom-games,Custom Games
- RULE-SET,cdn_domainset,代理节点 # 包含所有常见静态资源 CDN 域名、对象存储域名
- RULE-SET,cdn_non_ip,代理节点
# 一些后备规则
- RULE-SET,global,代理节点
- RULE-SET,proxy,代理节点 # 代理域名列表
- RULE-SET,gfw,代理节点 # GFWList 域名列表
- RULE-SET,tld-not-cn,代理节点 # 非中国大陆使用的顶级域名列表
# dns resolve
- RULE-SET,lancidr,DIRECT # 局域网 IP 及保留 IP 地址列表
#
- MATCH,Final
rule-providers:
ai_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/ai_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/ai.txt
apple_cdn:
behavior: domain
format: text
interval: 86400
path: ./providers/rule/apple_cdn.txt
type: http
url: https://ruleset.skk.moe/Clash/domainset/apple_cdn.txt
apple_cn_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/apple_cn_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/apple_cn.txt
apple_services:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/apple_services.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/apple_services.txt
applications:
behavior: classical
interval: 86400
path: ./providers/rule/applications.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt
cdn_domainset:
behavior: domain
format: text
interval: 86400
path: ./providers/rule/cdn_domainset.txt
type: http
url: https://ruleset.skk.moe/Clash/domainset/cdn.txt
cdn_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/cdn_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/cdn.txt
clash_fake_ip_filter:
behavior: classical
interval: 86400
path: ./providers/rule/clash_fake_ip_filter.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/test482/personl-clash-rule/master/clash_fake_ip_filter.yaml
custom-direct:
behavior: classical
interval: 86400
path: ./providers/rule/custom-direct.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/test482/personl-clash-rule/master/custom-direct.yaml
custom-games:
behavior: classical
interval: 86400
path: ./providers/rule/custom-games.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/test482/personl-clash-rule/master/custom-games.yaml
custom-proxy:
behavior: classical
interval: 86400
path: ./providers/rule/custom-proxy.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/test482/personl-clash-rule/master/custom-proxy.yaml
gfw:
behavior: domain
interval: 86400
path: ./providers/rule/gfw.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt
global:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/global.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/global.txt
jingdong:
behavior: classical
interval: 86400
path: ./providers/rule/jingdong.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/JingDong/JingDong.yaml
lancidr:
behavior: ipcidr
interval: 86400
path: ./providers/rule/lancidr.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt
microsoft_cdn_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/microsoft_cdn_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/microsoft_cdn.txt
microsoft_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/microsoft_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/microsoft.txt
private:
behavior: domain
interval: 86400
path: ./providers/rule/private.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt
proxy:
behavior: domain
interval: 86400
path: ./providers/rule/proxy.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt
reject:
behavior: domain
interval: 86400
path: ./providers/rule/reject.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt
steam:
behavior: classical
interval: 86400
path: ./providers/rule/steam.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Steam/Steam.yaml
steamcn:
behavior: classical
interval: 86400
path: ./providers/rule/steamcn.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/SteamCN/SteamCN.yaml
stream_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/stream_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/ip/stream.txt
stream_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/stream_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/stream.txt
telegram_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/telegram_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/ip/telegram.txt
telegram_non_ip:
behavior: classical
format: text
interval: 86400
path: ./providers/rule/telegram_non_ip.txt
type: http
url: https://ruleset.skk.moe/Clash/non_ip/telegram.txt
tiktok:
behavior: classical
interval: 86400
path: ./providers/rule/tiktok.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/TikTok/TikTok.yaml
tld-not-cn:
behavior: domain
interval: 86400
path: ./providers/rule/tld-not-cn.yaml
type: http
url: https://ghproxy.ecorp.one/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt
# Powershell command for allow loopback, use with admin
# if you need a GUI tool, look: https://apps.microsoft.com/detail/9NTJ6CX698CL?hl=zh-cn&gl=US
foreach($app in $(Get-AppPackage).PackageFamilyName) { CheckNetIsolation.exe LoopbackExempt -a -n="$app" > $null }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment