diff --git a/config_yml.yaml b/config_yml.yaml index aebb747..ee35328 100644 --- a/config_yml.yaml +++ b/config_yml.yaml @@ -10,17 +10,20 @@ 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_备用] # 容灾备用池 - # 故障转移只保留常用地区,避免 p3 大量“其他/冷门/失效”节点污染列表。 + 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|重置|套餐|建议|地址|更新)" @@ -31,7 +34,6 @@ p-common: &p-common 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" @@ -39,21 +41,23 @@ proxy-providers: <<: *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.huluma.dpdns.org/base64?token=4ad6c5809974691835305f3f4b2b1b1d" + 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: [] @@ -63,11 +67,11 @@ dns: ipv6: true listen: 0.0.0.0:1053 prefer-h3: false - respect-rules: true + respect-rules: false # 关键!改为 false,让 DNS 直连优先 cache-algorithm: arc cache-size: 2048 - use-hosts: false - use-system-hosts: false + use-hosts: true # 推荐开启 + use-system-hosts: true enhanced-mode: fake-ip fake-ip-range: 198.18.0.1/16 fake-ip-filter-mode: blacklist @@ -117,25 +121,22 @@ proxy-groups: - 全部节点 - 故障转移 - DIRECT + - 苹果直连 # 新增:手动选择也支持苹果直连 icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Proxy.png" - - name: 自动选择 type: url-test - <<: *u_s + <<: *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 + <<: *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 专项策略组 --- - # AI 保留为通用兜底;OpenAI / AISTudio 使用下方独立策略组。 - name: AI type: select proxies: @@ -144,9 +145,7 @@ proxy-groups: - 日本自动 - 台湾自动 - 自动选择 - # 移除节点选择,防止死循环 icon: "https://github.com/DustinWin/ruleset_geodata/releases/download/icons/ai.png" - - name: OpenAI type: select proxies: @@ -155,7 +154,6 @@ proxy-groups: - 日本自动 - 美国节点 icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/ChatGPT.png" - - name: AISTudio type: select proxies: @@ -164,21 +162,17 @@ proxy-groups: - 日本自动 - 美国节点 icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Google.png" - - # --- 3. 媒体平台策略组 --- - name: YouTube type: select proxies: [节点选择, 自动选择, 美国自动, 新加坡自动, 香港自动] icon: "https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/YouTube.png" - - # --- 4. 地区优选组 (自动测速,供策略组调用) --- + # --- 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. 地区节点组 (手动选择,展示所有节点) --- + # --- 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" } @@ -186,27 +180,41 @@ proxy-groups: - { 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,gateai.cc,美国节点 - DOMAIN-SUFFIX,hybgzs.com,DIRECT - DOMAIN-SUFFIX,baidu.com,DIRECT - - DOMAIN-SUFFIX,krill-ai.net,DIRECT + - DOMAIN-SUFFIX,krill-ai.net,DIRECT  - RULE-SET,AWAvenue_Ads_Rule,REJECT - - # --- 2. Google AISTudio 规则 (必须置顶于 google_domain 之前) --- + # --- 2. Google AISTudio 规则 --- - DOMAIN-SUFFIX,aistudio.google.com,AISTudio - DOMAIN-KEYWORD,aistudio,AISTudio - DOMAIN-KEYWORD,generativeai,AISTudio - - # --- 3. OpenAI 规则 (置顶于通用 AI 规则之前) --- + # --- 3. OpenAI 规则 --- - DOMAIN-SUFFIX,chat.openai.com,OpenAI - DOMAIN-SUFFIX,openai.com,OpenAI - DOMAIN-SUFFIX,chatgpt.com,OpenAI @@ -214,25 +222,19 @@ rules: - DOMAIN-SUFFIX,oaiusercontent.com,OpenAI - DOMAIN-KEYWORD,openai,OpenAI - DOMAIN-KEYWORD,chatgpt,OpenAI - # --- 4. AI 通用兜底 --- - # 放在 OpenAI / AISTudio 精确规则之后,避免专用服务被通用 AI 组抢走。 - RULE-SET,ai,AI - # --- 5. 媒体专项 --- - RULE-SET,youtube_domain,YouTube - RULE-SET,disney_domain,节点选择 - - # --- 6. Google 专项规则 (在 AISTudio 之后) --- + # --- 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,节点选择 @@ -243,12 +245,11 @@ 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" } + 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" } @@ -257,4 +258,4 @@ rule-providers: 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" } + google_domain: { <<: *domain, path: ./ruleset/google.mrs, url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/google.mrs" } \ No newline at end of file