Files
config_clash/config_yml.yaml
T
2026-08-31 09:47:06 +08:00

261 lines
13 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================== 基础设置 ===============================
port: 7890
socks-port: 7891
mixed-port: 7893
redir-port: 7892
tproxy-port: 7894
allow-lan: true
mode: rule
log-level: info
ipv6: true
unified-delay: true
tcp-concurrent: true
sniffer:
enable: true
sniff:
- HTTP
- TLS
- QUIC
# =============================== 机场订阅 ===============================
active-subs: &u_s
use: [机场01, 机场02] # 主力节点池
all-nodes: &u
use: [机场01, 机场02, 机场03_备用] # 全部节点池
backup-subs: &u_b
use: [机场03_备用] # 容灾备用池
filter: "(?i)(香港|hk|🇭🇰|hong\\s?kong|台湾|tw|🇹🇼|taiwan|新北|台中|台北|新加坡|狮城|sg|singapore|日本|东京|大阪|jp|japan|美国|us|united\\s?states|america|usa|英国|uk|united\\s?kingdom|德国|de|germany|韩国|kr|korea|荷兰|nl|netherlands)"
exclude-filter: "(?i)(DIRECT|Proxy|Traffic|Expire|Expired|过期|剩余|流量|官网|超时|timeout|失效|Invalid|Test|测速|本地|Local|重置|套餐|建议|地址|更新)"
# =============================== 订阅提供者 ===============================
p-common: &p-common
type: http
udp: true
interval: 86400
proxy: DIRECT
health-check: { enable: true, url: "http://www.gstatic.com/generate_204", interval: 600 }
proxy-providers:
机场01:
url: "https://au.qdvlqe.cn/NTIxMjc6NmVhZThjMmI5NDU5/NmZlNTI3NGExODU5NThlODhi/NGYxODdlZjFkNDVkMWVkMWFm/ZDlhZjFjYmJjM2MzZGZlMw"
path: ./proxy_provider/sub1.yaml
<<: *p-common
filter: "^(?!(.*流量|.*10x|.*6x|.*重置|.*到期|.*建议|.*官网|.*Expire|.*套餐|.*备用|.*线路|.*软件|.*地址|.*更新)).*$"
override: { additional-prefix: "p1 » " }
机场02:
url: "https://dy-2.xn--30rs3bu7r87f.com/csjc/api/v1/client/subscribe?token=a62ab7727142e1ff0320892c4628deda"
path: ./proxy_provider/sub2.yaml
<<: *p-common
filter: "^(?!(.*流量|.*10x|.*6x|.*重置|.*到期|.*建议|.*官网|.*Expire|.*套餐|.*地址|.*更新)).*$"
override: { additional-prefix: "p2 » " }
机场03_备用:
url: "https://sub.huxxxxx"
path: ./proxy_provider/sub3.yaml
<<: *p-common
filter: "^(?!(.*流量|.*10x|.*6x|.*重置|.*到期|.*建议|.*官网|.*Expire|.*套餐|.*地址|.*更新)).*$"
override: { additional-prefix: "p3_备用 » " }
# =============================== 规则集(苹果直连)===============================
rule-providers:
apple_domain: { <<: *yaml, path: ./ruleset/apple_domain.mrs, url: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Apple/Apple_Domain.yaml", behavior: domain, format: mrs }
# =============================== 节点信息 ===============================
proxies: []
# =============================== DNS 配置 ===============================
dns:
enable: true
ipv6: true
listen: 0.0.0.0:1053
prefer-h3: false
respect-rules: false # 关键!改为 false,让 DNS 直连优先
cache-algorithm: arc
cache-size: 2048
use-hosts: true # 推荐开启
use-system-hosts: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter-mode: blacklist
fake-ip-filter:
- "rule-set:private_domain"
- "rule-set:cn_domain"
- "geosite:connectivity-check"
- "geosite:private"
- "rule-set:fake_ip_filter_DustinWin"
default-nameserver:
- 223.5.5.5
- 119.29.29.29
nameserver:
- https://1.1.1.1/dns-query
- https://dns.google/dns-query
- 1.1.1.1
- 8.8.8.8
nameserver-policy:
"geosite:cn,private":
- https://223.5.5.5/dns-query
- 119.29.29.29
"geosite:gfw":
- https://1.1.1.1/dns-query
- 8.8.8.8
"rule-set:cn_domain,GeositeCN_Domain":
- 'https://223.5.5.5/dns-query'
fallback:
- 1.1.1.1
- 8.8.8.8
proxy-server-nameserver:
- https://1.1.1.1/dns-query
- 8.8.8.8
# =============================== 代理组设置 ===============================
proxy-groups:
# --- 1. 核心策略组 ---
- name: 节点选择
type: select
proxies:
- 自动选择
- AI
- 香港节点
- 台湾节点
- 新加坡节点
- 日本节点
- 美国节点
- 全部节点
- 故障转移
- DIRECT
- 苹果直连 # 新增:手动选择也支持苹果直连
icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Proxy.png"
- name: 自动选择
type: url-test
<<: *u_s
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
icon: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/icon/color/urltest.png"
- name: 故障转移
type: fallback
<<: *u_b
url: http://www.gstatic.com/generate_204
interval: 300
icon: "https://is1-ssl.mzstatic.com/image/thumb/Purple123/v4/77/7e/5a/777e5a23-cdcc-07e3-bac6-e691fa413307/AppIconok-0-0-1x_U007emarketing-0-0-0-10-0-85-220.png/400x400ia-75.webp"
# --- 2. AI 专项策略组 ---
- name: AI
type: select
proxies:
- 美国自动
- 新加坡自动
- 日本自动
- 台湾自动
- 自动选择
icon: "https://github.com/DustinWin/ruleset_geodata/releases/download/icons/ai.png"
- name: OpenAI
type: select
proxies:
- 美国自动
- 新加坡自动
- 日本自动
- 美国节点
icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/ChatGPT.png"
- name: AISTudio
type: select
proxies:
- 美国自动
- 新加坡自动
- 日本自动
- 美国节点
icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Google.png"
- name: YouTube
type: select
proxies: [节点选择, 自动选择, 美国自动, 新加坡自动, 香港自动]
icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/YouTube.png"
# --- 4. 地区优选组 ---
- { name: 香港自动, type: url-test, <<: *u_s, tolerance: 50, interval: 300, filter: "(?i)(香港|hk|🇭🇰|hong\\s?kong)", icon: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/release/icon/color/auto.png" }
- { name: 台湾自动, type: url-test, <<: *u_s, tolerance: 50, interval: 300, filter: "(?i)(台湾|tw|🇹🇼|taiwan|新北|台中|台北)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Taiwan.png" }
- { name: 新加坡自动, type: url-test, <<: *u_s, tolerance: 50, interval: 300, filter: "(?i)(🇸🇬|新加坡|狮城|SG|Singapore)", icon: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/release/icon/color/auto.png" }
- { name: 日本自动, type: url-test, <<: *u_s, tolerance: 50, interval: 300, filter: "(?i)(🇯🇵|日本|东京|大阪|JP|Japan)", icon: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/release/icon/color/auto.png" }
- { name: 美国自动, type: url-test, <<: *u_s, tolerance: 50, interval: 300, filter: "(?i)(🇺🇸|美国|US|united\\s?states|america|usa)", icon: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/release/icon/color/auto.png" }
# --- 5. 地区节点组 ---
- { name: 香港节点, type: select, <<: *u, include-all: true, filter: "(?i)(香港|hk|🇭🇰|hong\\s?kong)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Hong_Kong.png" }
- { name: 台湾节点, type: select, <<: *u, include-all: true, filter: "(?i)(台湾|tw|🇹🇼|taiwan)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Taiwan.png" }
- { name: 新加坡节点, type: select, <<: *u, include-all: true, filter: "(?i)(🇸🇬|新加坡|狮城|SG|Singapore)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Singapore.png" }
- { name: 日本节点, type: select, <<: *u, include-all: true, filter: "(?i)(🇯🇵|日本|东京|JP|japan)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Japan.png" }
- { name: 美国节点, type: select, <<: *u, include-all: true, filter: "(?i)(🇺🇸|美国|US|united\\s?states|america|usa)", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/United_States.png" }
- { name: 全部节点, type: select, <<: *u, include-all: true, filter: "(?i)^((?!(DIRECT|Proxy|Traffic|Expire|Expired|过期|剩余|流量|官网|超时|timeout|失效|Invalid|Test|测速|本地|Local)).)*$", icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/World_Map.png" }
- { name: 漏网之鱼, type: select, proxies: [节点选择, 自动选择, DIRECT], icon: "https://testingcf.jsdelivr.net/gh/aihdde/Rules@master/icon/fish.png" }
# --- 苹果直连组(新增)---
- name: 苹果直连
type: select
proxies:
- 节点选择
- 自动选择
- 香港自动
- 新加坡自动
- 美国自动
# =============================== 规则设置 ===============================
rules:
# --- 苹果直连(已存在)---
- RULE-SET,apple_domain,苹果直连,no-resolve
# --- 优化规则(新增,提前拦截常见直连/广告,提升匹配速度)---
- DOMAIN-SUFFIX,baidu.com,DIRECT
- RULE-SET,AWAvenue_Ads_Rule,REJECT
- DOMAIN-SUFFIX,apple.com,苹果直连 # 额外加强苹果直连
# --- 1. 自定义新增与广告规则 ---
- DOMAIN-SUFFIX,lilililwan.xyz,DIRECT
- DOMAIN-SUFFIX,opencode.ai,DIRECT
- DOMAIN-SUFFIX,sky1818.com,新加坡节点
- DOMAIN-SUFFIX,anyrouter.top,新加坡节点
- DOMAIN-SUFFIX,51688.qzz.io,美国节点
- DOMAIN-SUFFIX,hybgzs.com,DIRECT
- DOMAIN-SUFFIX,baidu.com,DIRECT
- DOMAIN-SUFFIX,krill-ai.net,DIRECT 
- RULE-SET,AWAvenue_Ads_Rule,REJECT
# --- 2. Google AISTudio 规则 ---
- DOMAIN-SUFFIX,aistudio.google.com,AISTudio
- DOMAIN-KEYWORD,aistudio,AISTudio
- DOMAIN-KEYWORD,generativeai,AISTudio
# --- 3. OpenAI 规则 ---
- DOMAIN-SUFFIX,chat.openai.com,OpenAI
- DOMAIN-SUFFIX,openai.com,OpenAI
- DOMAIN-SUFFIX,chatgpt.com,OpenAI
- DOMAIN-SUFFIX,oaistatic.com,OpenAI
- DOMAIN-SUFFIX,oaiusercontent.com,OpenAI
- DOMAIN-KEYWORD,openai,OpenAI
- DOMAIN-KEYWORD,chatgpt,OpenAI
# --- 4. AI 通用兜底 ---
- RULE-SET,ai,AI
# --- 5. 媒体专项 ---
- RULE-SET,youtube_domain,YouTube
- RULE-SET,disney_domain,节点选择
# --- 6. Google 专项规则 ---
- RULE-SET,google_domain,美国自动
# --- 7. IP 专项与直连规则 ---
- RULE-SET,telegram_ip,自动选择,no-resolve
- RULE-SET,geoip_cloudflare,节点选择,no-resolve
- RULE-SET,cn_domain,DIRECT
- RULE-SET,GeositeCN_Domain,DIRECT
- GEOIP,cn,DIRECT
# --- 8. 通用兜底规则 ---
- RULE-SET,gfw_domain,节点选择
- RULE-SET,proxy,节点选择
- MATCH,漏网之鱼
# =============================== 规则提供者 ===============================
rule-anchor:
ip: &ip { type: http, interval: 86400, behavior: ipcidr, format: mrs }
domain: &domain { type: http, interval: 86400, behavior: domain, format: mrs }
yaml: &yaml { type: http, interval: 86400, behavior: domain, format: yaml }
rule-providers:
AWAvenue_Ads_Rule: { <<: *yaml, path: ./ruleset/ads.yaml, url: "https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main//Filters/AWAvenue-Ads-Rule-Clash.yaml" }
GeositeCN_Domain: { type: 'http', behavior: 'domain', format: 'yaml', url: 'https://cdn.jsdelivr.net/gh/Accademia/Additional_Rule_For_Clash@latest/GeositeCN/GeositeCN_Domain.yaml', path: './ruleset/GeositeCN_Domain.yaml' }
cn_domain: { type: 'http', behavior: 'domain', format: 'yaml', url: 'https://cdn.jsdelivr.net/gh/Accademia/Additional_Rule_For_Clash@latest/ChinaMax/ChinaMax_Domain.yaml', path: './ruleset/ChinaMax_Domain.yaml' } 
fake_ip_filter_DustinWin: { <<: *domain, path: ./ruleset/fake_ip_filter_DustinWin.mrs, url: "https://github.com/DustinWin/ruleset_geodata/releases/download/mihomo-ruleset/fakeip-filter.mrs" }  
private_domain: { <<: *domain, path: ./ruleset/private_domain.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/private.mrs" }
gfw_domain: { <<: *domain, path: ./ruleset/gfw_domain.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/gfw.mrs" }
ai: { <<: *domain, path: ./ruleset/ai.mrs, url: "https://github.com/DustinWin/ruleset_geodata/releases/download/mihomo-ruleset/ai.mrs" }
youtube_domain: { <<: *domain, path: ./ruleset/youtube.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/youtube.mrs" }
disney_domain: { <<: *domain, path: ./ruleset/disney.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/disney.mrs" }
telegram_ip: { <<: *ip, path: ./ruleset/tg_ip.mrs, url: "https://github.com/DustinWin/ruleset_geodata/raw/refs/heads/mihomo-ruleset/telegramip.mrs" }
proxy: { <<: *domain, path: ./ruleset/proxy.mrs, url: "https://github.com/DustinWin/ruleset_geodata/releases/download/mihomo-ruleset/proxy.mrs" }
geoip_cloudflare: { <<: *ip, path: ./ruleset/cf_ip.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geoip/cloudflare.mrs" }
google_domain: { <<: *domain, path: ./ruleset/google.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/google.mrs" }