主要是在使用的时候，发现每个订阅的分组方式都不一样，规则也比较不同。找了一个可以统一的，复写脚本。还能添加自定义的规则。自定义规则在 config [“rules”] 中。// https://mihomo.party/docs/guide/override/javascript function main(config) { config["proxy-groups"] = [ { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/Static.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", name: "PROXY", type: "select", proxies: ["AUTO", "HK AUTO", "SG AUTO", "JP AUTO", "Asia AUTO", "US AUTO"], }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/Urltest.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置|[2-9]x|[1-9]0x", name: "AUTO", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/OpenAI.png", name: "AIGC", type: "select", proxies: ["SG AUTO", "JP AUTO", "US AUTO"], }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/Telegram.png", name: "Telegram", type: "select", proxies: ["HK AUTO", "SG AUTO", "JP AUTO", "US AUTO"], }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/Google.png", name: "Google", type: "select", proxies: ["HK AUTO", "SG AUTO", "JP AUTO", "US AUTO"], }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/HK.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", filter: "(?i)香港|Hong Kong|HK|🇭🇰", "exclude-filter": "[2-9]x|[1-9]0x", name: "HK AUTO", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/SG.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", filter: "(?i)新加坡|Singapore|🇸🇬", "exclude-filter": "[2-9]x|[1-9]0x", name: "SG AUTO", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/JP.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", filter: "(?i)日本|Japan|🇯🇵", "exclude-filter": "[2-9]x|[1-9]0x", name: "JP AUTO", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/HK.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", filter: "(?i)香港|Hong Kong|HK|🇭🇰|(?i)日本|Japan|🇯🇵|(?i)新加坡|Singapore|🇸🇬", "exclude-filter": "[2-9]x|[1-9]0x", name: "Asia AUTO", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/US.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", filter: "(?i)美国|USA|🇺🇸", name: "US AUTO", "exclude-filter": "[2-9]x|[1-9]0x", type: "url-test", interval: 300, }, { icon: "https://testingcf.jsdelivr.net/gh/Orz-3/mini@master/Color/Global.png", "include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|频道|订阅|ISP|流量|到期|重置", proxies: ["AUTO", "HK AUTO", "SG AUTO", "JP AUTO", "Asia AUTO", "US AUTO"], name: "GLOBAL", type: "select", } ]; if (!config['rule-providers']) { config['rule-providers'] = {}; } config["rule-providers"] = Object.assign(config["rule-providers"], { private: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/private.yaml", path: "./ruleset/private.yaml", behavior: "domain", interval: 86400, format: "yaml", type: "http", }, cn_domain: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/cn.yaml", path: "./ruleset/cn_domain.yaml", behavior: "domain", interval: 86400, format: "yaml", type: "http", }, telegram_domain: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/telegram.yaml", path: "./ruleset/telegram_domain.yaml", behavior: "domain", interval: 86400, format: "yaml", type: "http", }, google_domain: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/google.yaml", path: "./ruleset/google_domain.yaml", behavior: "domain", interval: 86400, format: "yaml", type: "http", }, "geolocation-!cn": { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/geolocation-!cn.yaml", path: "./ruleset/geolocation-!cn.yaml", behavior: "domain", interval: 86400, format: "yaml", type: "http", }, cn_ip: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/cn.yaml", path: "./ruleset/cn_ip.yaml", behavior: "ipcidr", interval: 86400, format: "yaml", type: "http", }, telegram_ip: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/telegram.yaml", path: "./ruleset/telegram_ip.yaml", behavior: "ipcidr", interval: 86400, format: "yaml", type: "http", }, google_ip: { url: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/google.yaml", path: "./ruleset/google_ip.yaml", behavior: "ipcidr", interval: 86400, format: "yaml", type: "http", }, bing: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Bing/Bing.yaml", path: "./ruleset/bing.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, copilot: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Copilot/Copilot.yaml", path: "./ruleset/copilot.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, claude: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Claude/Claude.yaml", path: "./ruleset/claude.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, bard: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/BardAI/BardAI.yaml", path: "./ruleset/bard.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, openai: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/OpenAI/OpenAI.yaml", path: "./ruleset/openai.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, steam: { url: "https://testingcf.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Steam/Steam.yaml", path: "./ruleset/steam.yaml", behavior: "classical", interval: 86400, format: "yaml", type: "http", }, }); config["rules"] = [ //------ 自定义 "IP-CIDR,100.78.0.0/8,DIRECT", "DOMAIN-SUFFIX,linux.do,PROXY", //------ "RULE-SET,private,DIRECT", "RULE-SET,bing,AIGC", "RULE-SET,copilot,AIGC", "RULE-SET,bard,AIGC", "RULE-SET,openai,AIGC", "RULE-SET,claude,AIGC", "RULE-SET,steam,PROXY", "RULE-SET,telegram_domain,Telegram", "RULE-SET,telegram_ip,Telegram", "RULE-SET,google_domain,Google", "RULE-SET,google_ip,Google", "RULE-SET,geolocation-!cn,PROXY", "RULE-SET,cn_domain,DIRECT", "RULE-SET,cn_ip,DIRECT", "MATCH,PROXY", ]; return config; } 📌 转载信息来源： https://linux.do/t/topic/1479363转载时间： 2026/1/18 19:09:43
极简自用，无花里胡哨，核心需求：精确分流全 CDN 高精度 GEO 集成主流 AI 分流性能兼容性优化 (IPv6/QUIC)DNS 分流不泄露微信苹果等服务优化使用方法：function main(config) { const allProxies = (config.proxies || []).map((p) => p.name).filter(Boolean); // --- 1. 全局资源与性能优化 (Hackl0us & Loyalsoldier) --- config["ipv6"] = false; config["unified-delay"] = true; config["tcp-concurrent"] = true; // 开启 Geodata 模式（必须开启才能使用 geosite/geoip 规则） config["geodata-mode"] = true; // 加载器设为 standard 或 memconservative 均可 config["geodata-loader"] = "standard"; // [核心] 替换为高精度资源地址 // 1. Geosite (域名): 使用 Loyalsoldier，规则最全 config["geosite-url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"; // 2. MMDB (IP): 使用 Hackl0us，国内 IP 精度最高 (小巧且精准) config["mmdb-url"] = "https://cdn.jsdelivr.net/gh/Hackl0us/GeoIP2-CN@release/Country.mmdb"; // 3. GeoIP (备用): 虽然主力是用 MMDB，但防止内核回退，也指向 Loyalsoldier config["geoip-url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"; // 自动判断下载 CDN（防止 Github 抽风） config["find-process-mode"] = "strict"; config["sniffer"] = { enable: true, sniff: { TLS: { ports: [443, 8443] }, HTTP: { ports: [80, "8080-8880"], "override-destination": true }, QUIC: { ports: [443] } } }; // --- 2. 策略组设置 --- const DNS_INTL_GROUP = "🛡️ DNS(国外)"; const NODE_GROUP = "🚀 节点选择"; const AUTO_GROUP = "♻️ 自动选择"; const AI_GROUP = "🤖 AI服务"; const EMBY_GROUP = "🎥 Emby服务"; const DIRECT_GROUP = "🎯 全球直连"; const FINAL_GROUP = "🐟 漏网之鱼"; // 筛选 AI 节点 (排除大陆和特定地区) const aiBlacklistRegex = /流量|到期|重置|香港|HK|Hong Kong|澳门|澳門|Macau|MO|俄罗斯|Russia|RU|伊朗|Iran|IR|朝鲜|North Korea|KP|叙利亚|Syria|SY|古巴|Cuba|CU|白俄罗斯|Belarus|BY|韩国|KR|Korea/i; const aiFilteredProxies = allProxies.filter(name => !aiBlacklistRegex.test(name)); // 筛选 Emby 节点 const embyFilteredProxies = allProxies.filter(name => /Emby/i.test(name)); config["proxy-groups"] = [ { name: NODE_GROUP, type: "select", proxies: [AUTO_GROUP, ...allProxies, "DIRECT"] }, { name: DNS_INTL_GROUP, type: "url-test", url: "https://www.gstatic.com/generate_204", interval: 300, proxies: allProxies.length ? allProxies : ["REJECT"] }, { name: AUTO_GROUP, type: "url-test", url: "https://www.gstatic.com/generate_204", interval: 300, tolerance: 50, proxies: allProxies.length ? allProxies : ["REJECT"] }, { name: EMBY_GROUP, type: "url-test", url: "http://www.gstatic.com/generate_204", interval: 300, tolerance: 50, proxies: embyFilteredProxies.length ? embyFilteredProxies : [NODE_GROUP] }, { name: AI_GROUP, type: "select", proxies: aiFilteredProxies.length ? [NODE_GROUP, ...aiFilteredProxies] : [NODE_GROUP, ...allProxies] }, { name: DIRECT_GROUP, type: "select", proxies: ["DIRECT", NODE_GROUP] }, { name: FINAL_GROUP, type: "select", proxies: [NODE_GROUP, DIRECT_GROUP] } ]; // --- 3. DNS 优化 --- const dnsCn = ["https://223.5.5.5/dns-query", "https://1.12.12.12/dns-query"]; const dnsIntl = ["https://8.8.8.8/dns-query", "https://1.1.1.1/dns-query"]; config["dns"] = { enable: true, ipv6: false, "enhanced-mode": "fake-ip", "respect-rules": true, "dns-hijack": ["any:53"], "nameserver": dnsCn, "proxy-server-nameserver": dnsCn, "fallback": dnsIntl, "nameserver-policy": { "geosite:cn": dnsCn, "geosite:gfw,geolocation-!cn": dnsIntl } }; // --- 4. 规则逻辑 (完全依赖 Geosite + 手动补充) --- config["rules"] = [ // 0. 本地网络 "IP-CIDR,127.0.0.0/8,DIRECT,no-resolve", "IP-CIDR,192.168.0.0/16,DIRECT,no-resolve", "IP-CIDR,10.0.0.0/8,DIRECT,no-resolve", "IP-CIDR,172.16.0.0/12,DIRECT,no-resolve", // 1. Apple 登录鉴权 "DOMAIN,appleid.apple.com," + AI_GROUP, "DOMAIN,idmsa.apple.com," + AI_GROUP, "DOMAIN,gsa.apple.com," + AI_GROUP, "DOMAIN,identity.apple.com," + AI_GROUP, // 2. Emby // 3. Apple 其他服务 "GEOSITE,apple," + DIRECT_GROUP, "DOMAIN-SUFFIX,apple.com," + DIRECT_GROUP, "DOMAIN-SUFFIX,icloud.com," + DIRECT_GROUP, // 4. 社交软件直连 "DOMAIN-KEYWORD,tencent," + DIRECT_GROUP, "DOMAIN-KEYWORD,qq," + DIRECT_GROUP, "DOMAIN-KEYWORD,wechat," + DIRECT_GROUP, // 5. 拦截 "AND,((DST-PORT,443),(NETWORK,UDP)),REJECT", "DOMAIN,dns.google," + DNS_INTL_GROUP, "DOMAIN,cloudflare-dns.com," + DNS_INTL_GROUP, "DST-PORT,53,REJECT", // 6. AI 规则 (使用 Loyalsoldier 的 Geosite 分类) "GEOSITE,openai," + AI_GROUP, "GEOSITE,anthropic," + AI_GROUP, "GEOSITE,x," + AI_GROUP, "GEOSITE,google," + AI_GROUP, "GEOSITE,youtube," + AI_GROUP, "DOMAIN-SUFFIX,bard.google.com," + AI_GROUP, "DOMAIN-SUFFIX,gemini.google.com," + AI_GROUP, "DOMAIN-SUFFIX,bing.com," + AI_GROUP, // 7. 国内分流 (使用 Hackl0us MMDB) "GEOSITE,cn," + DIRECT_GROUP, "GEOIP,CN," + DIRECT_GROUP + ",no-resolve", // 8. 兜底 "MATCH," + FINAL_GROUP ]; return config; } 📌 转载信息来源： https://linux.do/t/topic/1477877转载时间： 2026/1/18 15:52:21
原公益节点帖子【更新】高速无限流量订阅 (cloudflare snippets) 福利羊毛，Lv1原来的帖子不能编辑了，现在新增了很多备用地址。如果一个被封锁，可以换一个地址 双协议：vless websocket + trojan 利用 cloudflare 边缘网络的能力，网速十分快 + 无限访问次数 [img] （最新订阅删掉了很多优选）两协议，每个协议 4 个 CF 优选入口，合计 8 个节点（surge 不支持 vless，只能用 trojan） 一天 1…mihomo (clash) ECH 订阅地址这个地址仅供测试，它无法改动，只支持 mihomo (clash) https://download.nature.qq.com/SnsShare/Windy/1768620180_b65eb5ff_ech-mihomo前言公益节点的域名，用的人一多，就会被墙，我注册了好多域名，也死了一堆，在不断抗争中不断头大。抗封锁的进展这几天在 TG 群里看到 CMLiussss 更新了 v2ray/mihomo/singbox 一些 ECH 相关的功能。ech 是什么？ech 就是把你真实访问的目标加密传给 cloudflare，但是 cloudflare 能解密真实目标，对外只知道你往 cloudflare-ech.com 连接。全球大量免费的 cloudflare 套餐都强制开启 ech，墙如果杀掉 cloudflare-ech.com 会导致大量误伤。所以目前看还是挺稳的存在的问题但是 sing-box/xray/shadowRocket（小火箭) 等软件，需要固定的 ech 密钥，cloudflare 的 ech 是四个小时一变，就算要做订阅，也是需要设置 4 小时更新一次，用起来不是很方便。推荐的方法mihomo (clash 系列的继承者) 能自动抓取 ech 密钥，非常方便。订阅里依然使用 sni.111000.de5.net 这个被大部分地区屏蔽的域名，但不影响使用。推荐客户端安卓端：ClashMetaForAndroid v2.11.22 Releases · MetaCubeX/ClashMetaForAndroid · GitHub苹果端：clash mi ‎Clash Mi App - App StorePC 端 / 路由器 (nikki)，基本都能更新内核，更新到 v1.19.18 及以上版本即可。📌 转载信息来源： https://linux.do/t/topic/1472022转载时间： 2026/1/18 09:41:59
Sub-Converter 的模板，主要是对 dns 的部分做了一些适配，放置在 subconverter/base/clash.tpl，佬友们可以直接抄，或者觉得有不合理需要调整的地方也可以指正。mixed-port: 7890 allow-lan: false mode: rule log-level: info tcp-concurrent: true global-client-fingerprint: chrome ipv6: false external-controller: '127.0.0.1:9090' hosts: dns.google: - 8.8.8.8 - 8.8.4.4 - '2001:4860:4860::8888' - '2001:4860:4860::8844' doh.pub: - 1.12.12.12 - 1.12.12.21 - 120.53.53.53 dns.alidns.com: - 223.5.5.5 - 223.6.6.6 - '2400:3200::1' - '2400:3200:baba::1' tun: enable: true stack: mixed dns-hijack: - 'any:53' - 'tcp://any:53' auto-route: true auto-detect-interface: true strict-route: true route-exclude-address: - 192.168.0.0/16 - 'fc00::/7' clash-for-android: append-system-dns: false profile: tracing: true store-selected: true store-fake-ip: true sniffer: enable: true override-destination: false force-dns-mapping: true parse-pure-ip: true sniff: TLS: ports: - 443 - 8443 HTTP: ports: - 80 - 8080-8880 QUIC: ports: - 443 - 8443 skip-domain: - Mijia Cloud - +.push.apple.com experimental: sniff-tls-sni: true dns: enable: true prefer-h3: false listen: '127.0.0.1:8853' respect-rules: true ipv6: false cache-algorithm: arc enhanced-mode: fake-ip fake-ip-range: 198.18.0.1/16 fake-ip-range6: 'fc00::/18' fake-ip-filter: - '*.lan' - '*.local' - '*.localhost' - '*.home.arpa' - time.*.com - time.*.gov - time.*.apple.com - ntp.*.com - +.pool.ntp.org - +.msftconnecttest.com - +.msftncsi.com - +.srv.nintendo.net - +.stun.playstation.net - xbox.*.microsoft.com - +.battlenet.com.cn - +.music.163.com - +.y.qq.com - +.bilivideo.cn - localhost.ptlogin2.qq.com - lens.l.google.com default-nameserver: - 223.5.5.5 - 119.29.29.29 nameserver: - 'https://dns.alidns.com/dns-query' - 'https://doh.pub/dns-query' fallback: - 'https://dns.google/dns-query' - 'https://1.1.1.1/dns-query' proxy-server-nameserver: - 'https://dns.alidns.com/dns-query' - 'https://doh.pub/dns-query' direct-nameserver: - 'https://dns.alidns.com/dns-query' - 'https://doh.pub/dns-query' nameserver-policy: 'geosite:cn': - 'https://dns.alidns.com/dns-query' - 'https://doh.pub/dns-query' dl.google.com: - 223.5.5.5 - 119.29.29.29 dl.l.google.com: - 223.5.5.5 - 119.29.29.29 +.in-addr.arpa: 10.0.0.1 +.ip6.arpa: 10.0.0.1 fallback-filter: geoip: true geoip-code: CN geosite: - gfw ipcidr: - 0.0.0.0/8 - 10.0.0.0/8 - 100.64.0.0/10 - 127.0.0.0/8 - 169.254.0.0/16 - 172.16.0.0/12 - 192.168.0.0/16 - 240.0.0.0/4 {% if local.clash.new_field_name == "true" %} proxies: - name: dns-拦截 type: dns proxy-groups: ~ rules: ~ {% else %} Proxy: ~ Proxy Group: ~ Rule: - 'DST-PORT,53,dns-拦截' {% endif %} 📌 转载信息来源： https://linux.do/t/topic/1462012原作者： b1ghawk119转载时间： 2026/1/15 18:34:57
Mihomo SOCKS 覆写生成器为了方便使用指纹浏览器的代理节点，所以找了个项目改了一下一键为代理节点分配独立端口，想用哪个节点，直接连接对应端口！在线使用Mihomo 覆写转换 - 老何的 AIGC 研究室三步上手复制你的代理节点配置（proxies 部分）粘贴到左侧输入框，设置起始端口（默认 52000）点击生成，复制配置到 Mihomo 覆写文件效果每个节点获得独立端口，支持 HTTP/SOCKS5：节点 A → 127.0.0.1:52000节点 B → 127.0.0.1:52001节点 C → 127.0.0.1:52002特点纯前端处理，数据不上传增量合并，不破坏原有配置支持深色模式开箱即用，无需安装作者： HeGenAI | 老何的 AIGC 研究室项目： GitHub - msola-ht/Mihomo_SOCKS_Gen📌 转载信息来源： https://linux.do/t/topic/1427091原作者： M111转载时间： 2026/1/11 08:50:52
自用的 mihomo 配置分享，有完整配置和覆写脚本以及单规则的覆写脚本个人配置仓库 Ayanami0 的配置仓库配置不一定适合所有人，可以自行更改以下是两个配置文件的预览完整配置###Ayanami0's config_full### mixed-port: 7890 redir-port: 7891 tproxy-port: 1536 ipv6: false mode: Rule allow-lan: true bind-address: "*" disable-keep-alive: true unified-delay: true tcp-concurrent: true log-level: silent find-process-mode: strict global-client-fingerprint: random external-controller: 127.0.0.1:9090 secret: "123456" external-ui: WebUI/Zashboard external-ui-url: "https://github.com/Zephyruso/zashboard/releases/latest/download/dist-no-fonts.zip" external-controller-cors: allow-origins: - "*" allow-private-network: true profile: store-selected: true store-fake-ip: true # ————————— p: &p type: http interval: 86400 health-check: enable: true url: https://cp.cloudflare.com interval: 300 proxy: DIRECT header: User-Agent: - "clash-verge/v2.2.3" - "ClashMetaForAndroid/2.11.2.Meta" - "ClashforWindows/0.19.23" - "clash.meta" - "mihomo" proxy-providers: α: <<: *p override: additional-prefix: "α-" path: ./proxies/α.yaml url: ##"订阅链接"## β: <<: *p override: additional-prefix: "β-" path: ./proxies/β.yaml url: ##"订阅链接"## γ: <<: *p override: additional-prefix: "γ-" path: ./proxies/γ.yaml url: ##"订阅链接"## δ: <<: *p override: additional-prefix: "δ-" path: ./proxies/δ.yaml url: ##"订阅链接"## # ————————— sniffer: enable: true force-dns-mapping: true parse-pure-ip: true override-destination: true sniff: HTTP: ports: [80, 8080-8880] TLS: ports: [443, 8443] QUIC: ports: [443, 8443] force-domain: - "+.v2ex.com" skip-domain: - "Mijia Cloud" - "+.push.apple.com" # ————————— tun: enable: false device: Meta stack: mixed dns-hijack: - any:53 - tcp://any:53 udp-timeout: 300 auto-route: true strict-route: true auto-redirect: false auto-detect-interface: true # ————————— dns: enable: true ipv6: false listen: 0.0.0.0:1053 prefer-h3: false # 如果DNS服务器支持DoH3会优先使用h3，默认关 respect-rules: true # 让连接DNS服务器时能够遵循规则 cache-algorithm: arc # 使用性能更优的 ARC 缓存算法 cache-size: 2048 # 限制缓存大小，避免占用过多内存 enhanced-mode: fake-ip fake-ip-range: 198.18.0.1/16 fake-ip-filter-mode: blacklist fake-ip-filter: - "*.lan" - "*.local" - "time.*.com" - "ntp.*.com" - "RULE-SET:Private_Domain" - "RULE-SET:GoogleFCM_Domain" default-nameserver: - 223.5.5.5 - 119.29.29.29 - 223.6.6.6 direct-nameserver: - https://dns.alidns.com/dns-query - https://doh.pub/dns-query proxy-server-nameserver: - https://dns.alidns.com/dns-query - https://doh.pub/dns-query nameserver: - https://dns.google/dns-query - https://cloudflare-dns.com/dns-query nameserver-policy: "RULE-SET:ChinaMax_Domain,Microsoft_Domain,Apple_Domain": - https://dns.alidns.com/dns-query - https://doh.pub/dns-query # ————————— lite: &lite type: select include-all: true pg: &pg type: select proxies: - PROXY - HK - SG - JP - TW - US - WD - LowRate - DIRECT proxy-groups: - name: PROXY icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/All.svg" type: select proxies: - HK - SG - JP - TW - US - WD - LowRate - DIRECT include-all: true - name: HK icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Hong_Kong.png" filter: "^(?=.*(港|HK|hk|Hong Kong|HongKong|hongkong)).*$" <<: *lite - name: SG icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Singapore.png" filter: "^(?=.*(新加坡|坡|狮城|SG|Singapore)).*$" <<: *lite - name: JP icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Japan.png" filter: "^(?=.*(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan)).*$" <<: *lite - name: TW icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Taiwan.png" filter: "^(?=.*(台|新北|彰化|TW|Taiwan)).*$" <<: *lite - name: US icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_States.png" filter: "^(?=.*(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States|UnitedStates)).*$" <<: *lite - name: WD icon: "https://raw.githubusercontent.com/GitMetaio/Surfing/refs/heads/rm/Home/icon/Globe.svg" filter: "^(?!.*(港|HK|hk|Hong Kong|HongKong|hongkong|日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States|UnitedStates|台|新北|彰化|TW|Taiwan|新加坡|坡|狮城|SG|Singapore|灾|网易|Netease|套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网)).*$" <<: *lite - name: LowRate icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Download.png" filter: (?<![0-9])0\.(?:0[0-9]{1,2}|[1-9])(?![0-9]) <<: *lite - name: ADS icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/No-ads-all.svg" type: select proxies: - REJECT - PROXY - name: GAME icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Steam.svg" type: select proxies: - DIRECT - PROXY - name: Apple icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Apple.svg" type: select proxies: - DIRECT - PROXY - name: Microsoft icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Microsoft.svg" type: select proxies: - DIRECT - PROXY - name: GoogleFCM icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/GoogleFCM.svg" type: select proxies: - DIRECT - PROXY - name: Emby icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Emby.png" <<: *pg - name: Telegram icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Telegram.svg" <<: *pg - name: Discord icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Discord.svg" <<: *pg - name: Spotify icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Spotify.svg" <<: *pg - name: TikTok icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/TikTok.svg" <<: *pg - name: YouTube icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/YouTube.svg" <<: *pg - name: Netflix icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Netflix.svg" <<: *pg - name: Google icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Google.svg" <<: *pg - name: Facebook icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Facebook.svg" <<: *pg - name: OpenAI icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/OpenAI.svg" <<: *pg - name: GitHub icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/GitHub.svg" <<: *pg - name: Twitter(X) icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Twitter.svg" <<: *pg - name: FINAL icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/HBASE-copy.svg" <<: *pg - name: LOWEST icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: url-test filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true - name: FALLBACK icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: fallback filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true - name: BALANCE icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: load-balance strategy: round-robin filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true # ————————— rule-anchor: YAML: &YAML {type: http, behavior: classical, format: yaml, interval: 86400} IPCIDR: &IPCIDR {type: http, behavior: ipcidr, format: mrs, interval: 86400} Domain: &Domain {type: http, behavior: domain, format: mrs, interval: 86400} rule-providers: ###国内/私有### ChinaMax_IP: <<: *IPCIDR path: ./rules/ChinaMax_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/ChinaMax/ChinaMax_OCD_IP.mrs" ChinaMax_Domain: <<: *Domain path: ./rules/ChinaMax_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/ChinaMax/ChinaMax_OCD_Domain.mrs" Private_Domain: <<: *Domain path: ./rules/Lan_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Lan/Lan_OCD_Domain.mrs" Private_IP: <<: *IPCIDR path: ./rules/Lan_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Lan/Lan_OCD_IP.mrs" ###直连/代理规则### Direct: <<: *YAML path: ./ruleset/direct.yaml url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Direct/Direct.yaml" Global_Domain: <<: *Domain path: ./rules/Global_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Global/Global_OCD_Domain.mrs" Global_IP: <<: *IPCIDR path: ./rules/Global_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Global/Global_OCD_IP.mrs" ###去广告### AWAvenue_Ads_Rule: <<: *YAML path: ./ruleset/AWAvenue_Ads_Rule_Clash.yaml url: "https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main//Filters/AWAvenue-Ads-Rule-Clash.yaml" ###游戏### Game_Domain: <<: *Domain path: ./rules/Game_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/Game_OCD_Domain.mrs" Game_IP: <<: *IPCIDR path: ./rules/Game_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/Game_OCD_IP.mrs" GameDownload_Domain: <<: *Domain path: ./rules/GameDownload_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/GameDownload/GameDownload_OCD_Domain.mrs" ###国外### Emby_Domain: <<: *Domain path: ./rules/Emby_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Emby/Emby_OCD_Domain.mrs" TikTok_Domain: <<: *Domain path: ./rules/TikTok.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/TikTok/TikTok_OCD_Domain.mrs" Spotify_Domain: <<: *Domain path: ./rules/Spotify.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Spotify/Spotify_OCD_Domain.mrs" Spotify_IP: <<: *IPCIDR path: ./rules/Spotify_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Spotify/Spotify_OCD_IP.mrs" Facebook_Domain: <<: *Domain path: ./rules/Facebook.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Facebook/Facebook_OCD_Domain.mrs" Facebook_IP: <<: *IPCIDR path: ./rules/Facebook_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Facebook/Facebook_OCD_IP.mrs" Telegram_Domain: <<: *Domain path: ./rules/Telegram.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_OCD_Domain.mrs" Telegram_IP: <<: *IPCIDR path: ./rules/Telegram_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_OCD_IP.mrs" Telegram_No_Resolve: <<: *YAML path: ./rules/Telegram_No_Resolve.yaml url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_No_Resolve.yaml" YouTube_Domain: <<: *Domain path: ./rules/YouTube.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/YouTube/YouTube_OCD_Domain.mrs" YouTube_IP: <<: *IPCIDR path: ./rules/YouTube_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/YouTube/YouTube_OCD_IP.mrs" Google_Domain: <<: *Domain path: ./rules/Google.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Google/Google_OCD_Domain.mrs" Google_IP: <<: *IPCIDR path: ./rules/Google_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Google/Google_OCD_IP.mrs" GoogleFCM_Domain: <<: *Domain path: ./rules/GoogleFCM.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GoogleFCM/GoogleFCM_OCD_Domain.mrs" GoogleFCM_IP: <<: *IPCIDR path: ./rules/GoogleFCM_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GoogleFCM/GoogleFCM_OCD_IP.mrs" Microsoft_Domain: <<: *Domain path: ./rules/Microsoft.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Microsoft/Microsoft_OCD_Domain.mrs" Apple_Domain: <<: *Domain path: ./rules/Apple.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Apple/Apple_OCD_Domain.mrs" Apple_IP: <<: *IPCIDR path: ./rules/Apple_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Apple/Apple_OCD_IP.mrs" OpenAI_Domain: <<: *Domain path: ./rules/OpenAI.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/OpenAI/OpenAI_OCD_Domain.mrs" OpenAI_IP: <<: *IPCIDR path: ./rules/OpenAI_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/OpenAI/OpenAI_OCD_IP.mrs" Netflix_Domain: <<: *Domain path: ./rules/Netflix.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Netflix/Netflix_OCD_Domain.mrs" Netflix_IP: <<: *IPCIDR path: ./rules/Netflix_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Netflix/Netflix_OCD_IP.mrs" Discord_Domain: <<: *Domain path: ./rules/Discord.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Discord/Discord_OCD_Domain.mrs" GitHub_Domain: <<: *Domain path: ./rules/GitHub.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GitHub/GitHub_OCD_Domain.mrs" Twitter_Domain: <<: *Domain path: ./rules/Twitter.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Twitter/Twitter_OCD_Domain.mrs" Twitter_IP: <<: *IPCIDR path: ./rules/Twitter_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Twitter/Twitter_OCD_IP.mrs" rules: - DST-PORT,53,DIRECT - DST-PORT,853,DIRECT - RULE-SET,Direct,DIRECT #直连规则 - RULE-SET,AWAvenue_Ads_Rule,ADS #去广告 - RULE-SET,Game_Domain,Game #游戏，走直连 - RULE-SET,Game_IP,Game - RULE-SET,GameDownload_Domain,Game - RULE-SET,ChinaMax_Domain,DIRECT,no-resolve - RULE-SET,ChinaMax_IP,DIRECT - RULE-SET,Private_Domain,DIRECT - RULE-SET,Private_IP,DIRECT - RULE-SET,Emby_Domain,Emby - RULE-SET,GitHub_Domain,GitHub - RULE-SET,Discord_Domain,Discord - RULE-SET,TikTok_Domain,TikTok - RULE-SET,Twitter_Domain,Twitter(X) - RULE-SET,Twitter_IP,Twitter(X) - RULE-SET,YouTube_Domain,YouTube - RULE-SET,YouTube_IP,YouTube - RULE-SET,GoogleFCM_Domain,GoogleFCM - RULE-SET,GoogleFCM_IP,GoogleFCM - RULE-SET,Google_Domain,Google - RULE-SET,Google_IP,Google - RULE-SET,Netflix_Domain,Netflix - RULE-SET,Netflix_IP,Netflix - RULE-SET,Spotify_Domain,Spotify - RULE-SET,Spotify_IP,Spotify - RULE-SET,Facebook_Domain,Facebook - RULE-SET,Facebook_IP,Facebook - RULE-SET,OpenAI_Domain,OpenAI - RULE-SET,OpenAI_IP,OpenAI - RULE-SET,Apple_Domain,Apple - RULE-SET,Apple_IP,Apple - RULE-SET,Microsoft_Domain,Microsoft - RULE-SET,Telegram_Domain,Telegram - RULE-SET,Telegram_IP,Telegram,no-resolve - RULE-SET,Telegram_No_Resolve,Telegram,no-resolve - DOMAIN,browserleaks.com,FINAL - RULE-SET,Global_Domain,PROXY - RULE-SET,Global_IP,PROXY - MATCH,FINAL # ————————— 覆写脚本 (规则组和策略组版)###Ayanami0's override_rule-full### lite: &lite type: select include-all: true pg: &pg type: select proxies: - PROXY - HK - SG - JP - TW - US - WD - LowRate - DIRECT proxy-groups: - name: PROXY icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/All.svg" type: select proxies: - HK - SG - JP - TW - US - WD - LowRate - DIRECT include-all: true - name: HK icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Hong_Kong.png" filter: "^(?=.*(港|HK|hk|Hong Kong|HongKong|hongkong)).*$" <<: *lite - name: SG icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Singapore.png" filter: "^(?=.*(新加坡|坡|狮城|SG|Singapore)).*$" <<: *lite - name: JP icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Japan.png" filter: "^(?=.*(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan)).*$" <<: *lite - name: TW icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Taiwan.png" filter: "^(?=.*(台|新北|彰化|TW|Taiwan)).*$" <<: *lite - name: US icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_States.png" filter: "^(?=.*(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States|UnitedStates)).*$" <<: *lite - name: WD icon: "https://raw.githubusercontent.com/GitMetaio/Surfing/refs/heads/rm/Home/icon/Globe.svg" filter: "^(?!.*(港|HK|hk|Hong Kong|HongKong|hongkong|日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States|UnitedStates|台|新北|彰化|TW|Taiwan|新加坡|坡|狮城|SG|Singapore|灾|网易|Netease|套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网)).*$" <<: *lite - name: LowRate icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Download.png" filter: (?<![0-9])0\.(?:0[0-9]{1,2}|[1-9])(?![0-9]) <<: *lite - name: ADS icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/No-ads-all.svg" type: select proxies: - REJECT - PROXY - name: GAME icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Steam.svg" type: select proxies: - DIRECT - PROXY - name: Apple icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Apple.svg" type: select proxies: - DIRECT - PROXY - name: Microsoft icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Microsoft.svg" type: select proxies: - DIRECT - PROXY - name: GoogleFCM icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/GoogleFCM.svg" type: select proxies: - DIRECT - PROXY - name: Emby icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Emby.png" <<: *pg - name: Telegram icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Telegram.svg" <<: *pg - name: Discord icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Discord.svg" <<: *pg - name: Spotify icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Spotify.svg" <<: *pg - name: TikTok icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/TikTok.svg" <<: *pg - name: YouTube icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/YouTube.svg" <<: *pg - name: Netflix icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Netflix.svg" <<: *pg - name: Google icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Google.svg" <<: *pg - name: Facebook icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Facebook.svg" <<: *pg - name: OpenAI icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/OpenAI.svg" <<: *pg - name: GitHub icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/GitHub.svg" <<: *pg - name: Twitter(X) icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Twitter.svg" <<: *pg - name: FINAL icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/HBASE-copy.svg" <<: *pg - name: LOWEST icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: url-test filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true - name: FALLBACK icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: fallback filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true - name: BALANCE icon: "https://cdn.jsdelivr.net/gh/GitMetaio/Surfing@rm/Home/icon/Return.svg" type: load-balance strategy: round-robin filter: "^(?!.*(套餐|重置|剩余|到期|订阅|群|账户|流量|有效期|时间|官网|失联|余额)).*$" include-all: true # ————————— rule-anchor: YAML: &YAML {type: http, behavior: classical, format: yaml, interval: 86400} IPCIDR: &IPCIDR {type: http, behavior: ipcidr, format: mrs, interval: 86400} Domain: &Domain {type: http, behavior: domain, format: mrs, interval: 86400} rule-providers: ###国内/私有### ChinaMax_IP: <<: *IPCIDR path: ./rules/ChinaMax_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/ChinaMax/ChinaMax_OCD_IP.mrs" ChinaMax_Domain: <<: *Domain path: ./rules/ChinaMax_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/ChinaMax/ChinaMax_OCD_Domain.mrs" Private_Domain: <<: *Domain path: ./rules/Lan_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Lan/Lan_OCD_Domain.mrs" Private_IP: <<: *IPCIDR path: ./rules/Lan_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Lan/Lan_OCD_IP.mrs" ###直连/代理规则### Direct: <<: *YAML path: ./ruleset/direct.yaml url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Direct/Direct.yaml" Global_Domain: <<: *Domain path: ./rules/Global_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Global/Global_OCD_Domain.mrs" Global_IP: <<: *IPCIDR path: ./rules/Global_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Global/Global_OCD_IP.mrs" ###去广告### AWAvenue_Ads_Rule: <<: *YAML path: ./ruleset/AWAvenue_Ads_Rule_Clash.yaml url: "https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main//Filters/AWAvenue-Ads-Rule-Clash.yaml" ###游戏### Game_Domain: <<: *Domain path: ./rules/Game_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/Game_OCD_Domain.mrs" Game_IP: <<: *IPCIDR path: ./rules/Game_OCD_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/Game_OCD_IP.mrs" GameDownload_Domain: <<: *Domain path: ./rules/GameDownload_OCD_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Game/GameDownload/GameDownload_OCD_Domain.mrs" ###国外### Emby_Domain: <<: *Domain path: ./rules/Emby_Domain.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Emby/Emby_OCD_Domain.mrs" TikTok_Domain: <<: *Domain path: ./rules/TikTok.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/TikTok/TikTok_OCD_Domain.mrs" Spotify_Domain: <<: *Domain path: ./rules/Spotify.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Spotify/Spotify_OCD_Domain.mrs" Spotify_IP: <<: *IPCIDR path: ./rules/Spotify_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Spotify/Spotify_OCD_IP.mrs" Facebook_Domain: <<: *Domain path: ./rules/Facebook.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Facebook/Facebook_OCD_Domain.mrs" Facebook_IP: <<: *IPCIDR path: ./rules/Facebook_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Facebook/Facebook_OCD_IP.mrs" Telegram_Domain: <<: *Domain path: ./rules/Telegram.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_OCD_Domain.mrs" Telegram_IP: <<: *IPCIDR path: ./rules/Telegram_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_OCD_IP.mrs" Telegram_No_Resolve: <<: *YAML path: ./rules/Telegram_No_Resolve.yaml url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Telegram/Telegram_No_Resolve.yaml" YouTube_Domain: <<: *Domain path: ./rules/YouTube.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/YouTube/YouTube_OCD_Domain.mrs" YouTube_IP: <<: *IPCIDR path: ./rules/YouTube_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/YouTube/YouTube_OCD_IP.mrs" Google_Domain: <<: *Domain path: ./rules/Google.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Google/Google_OCD_Domain.mrs" Google_IP: <<: *IPCIDR path: ./rules/Google_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Google/Google_OCD_IP.mrs" GoogleFCM_Domain: <<: *Domain path: ./rules/GoogleFCM.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GoogleFCM/GoogleFCM_OCD_Domain.mrs" GoogleFCM_IP: <<: *IPCIDR path: ./rules/GoogleFCM_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GoogleFCM/GoogleFCM_OCD_IP.mrs" Microsoft_Domain: <<: *Domain path: ./rules/Microsoft.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Microsoft/Microsoft_OCD_Domain.mrs" Apple_Domain: <<: *Domain path: ./rules/Apple.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Apple/Apple_OCD_Domain.mrs" Apple_IP: <<: *IPCIDR path: ./rules/Apple_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Apple/Apple_OCD_IP.mrs" OpenAI_Domain: <<: *Domain path: ./rules/OpenAI.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/OpenAI/OpenAI_OCD_Domain.mrs" OpenAI_IP: <<: *IPCIDR path: ./rules/OpenAI_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/OpenAI/OpenAI_OCD_IP.mrs" Netflix_Domain: <<: *Domain path: ./rules/Netflix.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Netflix/Netflix_OCD_Domain.mrs" Netflix_IP: <<: *IPCIDR path: ./rules/Netflix_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Netflix/Netflix_OCD_IP.mrs" Discord_Domain: <<: *Domain path: ./rules/Discord.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Discord/Discord_OCD_Domain.mrs" GitHub_Domain: <<: *Domain path: ./rules/GitHub.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/GitHub/GitHub_OCD_Domain.mrs" Twitter_Domain: <<: *Domain path: ./rules/Twitter.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Twitter/Twitter_OCD_Domain.mrs" Twitter_IP: <<: *IPCIDR path: ./rules/Twitter_IP.mrs url: "https://cdn.jsdelivr.net/gh/Ayanami0xL1l1th/Rule-for-OCD@master/rule/Clash/Twitter/Twitter_OCD_IP.mrs" rules: - DST-PORT,53,DIRECT - DST-PORT,853,DIRECT - RULE-SET,Direct,DIRECT #直连规则 - RULE-SET,AWAvenue_Ads_Rule,ADS #去广告 - RULE-SET,Game_Domain,Game #游戏，走直连 - RULE-SET,Game_IP,Game - RULE-SET,GameDownload_Domain,Game - RULE-SET,ChinaMax_Domain,DIRECT,no-resolve - RULE-SET,ChinaMax_IP,DIRECT - RULE-SET,Private_Domain,DIRECT - RULE-SET,Private_IP,DIRECT - RULE-SET,Emby_Domain,Emby - RULE-SET,GitHub_Domain,GitHub - RULE-SET,Discord_Domain,Discord - RULE-SET,TikTok_Domain,TikTok - RULE-SET,Twitter_Domain,Twitter(X) - RULE-SET,Twitter_IP,Twitter(X) - RULE-SET,YouTube_Domain,YouTube - RULE-SET,YouTube_IP,YouTube - RULE-SET,GoogleFCM_Domain,GoogleFCM - RULE-SET,GoogleFCM_IP,GoogleFCM - RULE-SET,Google_Domain,Google - RULE-SET,Google_IP,Google - RULE-SET,Netflix_Domain,Netflix - RULE-SET,Netflix_IP,Netflix - RULE-SET,Spotify_Domain,Spotify - RULE-SET,Spotify_IP,Spotify - RULE-SET,Facebook_Domain,Facebook - RULE-SET,Facebook_IP,Facebook - RULE-SET,OpenAI_Domain,OpenAI - RULE-SET,OpenAI_IP,OpenAI - RULE-SET,Apple_Domain,Apple - RULE-SET,Apple_IP,Apple - RULE-SET,Microsoft_Domain,Microsoft - RULE-SET,Telegram_Domain,Telegram - RULE-SET,Telegram_IP,Telegram,no-resolve - RULE-SET,Telegram_No_Resolve,Telegram,no-resolve - DOMAIN,browserleaks.com,FINAL - RULE-SET,Global_Domain,PROXY - RULE-SET,Global_IP,PROXY - MATCH,FINAL # ————————— 预览就放这么多，还有一般版和超级精简版 (纯 geo) 的一些配置文件，可以在仓库中查看📌 转载信息来源： https://linux.do/t/topic/1426518转载时间： 2026/1/10 19:11:02
最初用 Adguard Home 部署，近期又接触了 Mosdns-x，又是一番折腾完整的 mosdns-x 配置在最底下，有配套的数据看板（需要 Mihomo 完整配置文件，其实写的一坨，想 “欣赏” 的可以留言 ）Adguard Home DoH 服务与 mihomo 配置客户端说明：ns：默认使用 NextDNS 与谷歌 dns 作为上游m-cn：主要用于解析国内域名m-psn：国内外上游，主要用于 proxy-server-nameserver（m-psn，是因为之前用宝可梦，他家机场部分域名用国外 dns 获取不到结果，所以单独整了个 adgh 客户端用于 proxy-server-nameserver）pure：纯净 dns，未开启广告拦截，使用 NextDNS 与谷歌 dns 作为上游m-ad：为了方便看 adgh 的拦截日志，搞的客户端，上游同 ns（配置时使用 ns 就行） DoH 地址： 两台 US 服务器部署：US2、US3 - https://us2.tls.vlo.cc/alicia/m-ad - https://us2.tls.vlo.cc/alicia/ns - https://us2.tls.vlo.cc/alicia/m-cn - https://us2.tls.vlo.cc/alicia/m-psn - https://us3.tls.vlo.cc/alicia/m-ad - https://us3.tls.vlo.cc/alicia/m-psn - https://us3.tls.vlo.cc/alicia/m-cn - https://us3.tls.vlo.cc/alicia/ns mihomo 配套的配置模板，使用 redir-host 模式并不是最优配置，且这两个模块都引用了规则集：rule-set:，请替换为自己配置文件的规则集或者删除。 嗅探模块 # 流量嗅探 sniffer: enable: true force-dns-mapping: true parse-pure-ip: true override-destination: false sniff: HTTP: ports: [80, 8080-8880, 2052, 2082, 2086, 2095] override-destination: true TLS: ports: [443, 8443, 2053, 2083, 2087, 2096] QUIC: ports: [443, 8443, 2053, 2083, 2087, 2096] skip-domain: - "rule-set:DW_Private,qiufeng_domain,Advertising,Tracking,MX_FCM" skip-src-address: - "rule-set:DW_PrivateIP,Advertising_IP" - 169.254.10.100/32 - febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 skip-dst-address: - "rule-set:DW_PrivateIP,Advertising_IP" - 169.254.10.100/32 - febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 - "rule-set:LL_TgIP,Skk_TgIP" hosts 与 dns 模块 # hosts模块 hosts: '*.alicia.moe': 127.0.0.1 'alicia.moe': 127.0.0.1 'us3.tls.vlo.cc': 38.246.246.231 'us2.tls.vlo.cc': 154.37.208.14 'tls-us-2.vlo.cc': 38.244.62.224 'tls-us-1.vlo.cc': 154.37.208.14 'cn-09.api.vlo.cc': 38.244.62.224 'cn-05.api.vlo.cc': 154.37.208.14 # dns模块 dns: enable: true cache-algorithm: arc prefer-h3: false use-hosts: true use-system-hosts: false listen: 0.0.0.0:1053 ipv6: false respect-rules: false enhanced-mode: redir-host fake-ip-range: 10.20.0.1/16 default-nameserver: - quic://223.5.5.5 - tls://1.12.12.12 nameserver: - https://us3.tls.vlo.cc/alicia/ns - https://us2.tls.vlo.cc/alicia/ns nameserver-policy: "rule-set:mydns_domain,myblack_domain,qiufeng_domain,Advertising,Tracking": - https://us2.tls.vlo.cc/alicia/m-ad - https://us3.tls.vlo.cc/alicia/m-ad "rule-set:MX_SteamCN,DW_GamesCN,Skk_Direct,Skk_Domestic,DW_CN,LL_China": - https://us2.tls.vlo.cc/alicia/m-cn - https://us3.tls.vlo.cc/alicia/m-cn proxy-server-nameserver: - https://us2.tls.vlo.cc/alicia/m-psn - https://us3.tls.vlo.cc/alicia/m-psn mosdns-x DoH 服务以及 mihomo 配置直接在 mosdns-x 进行分流的。AI 搓出来的数据面板：https://api.520924.xyz DoH 地址： 同样在两台 US 服务器部署- https://cn-05.api.vlo.cc/tls-cx - https://cn-09.api.vlo.cc/tls-cx mihomo 配置：同样使用 redir-hosts 模式 嗅探模块 # 流量嗅探 sniffer: enable: true force-dns-mapping: true parse-pure-ip: true override-destination: false sniff: HTTP: ports: [80, 8080-8880, 2052, 2082, 2086, 2095] override-destination: true TLS: ports: [443, 8443, 2053, 2083, 2087, 2096] QUIC: ports: [443, 8443, 2053, 2083, 2087, 2096] skip-domain: - "rule-set:DW_Private,qiufeng_domain,Advertising,Tracking,MX_FCM" skip-src-address: - "rule-set:DW_PrivateIP,Advertising_IP" - 169.254.10.100/32 - febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 skip-dst-address: - "rule-set:DW_PrivateIP,Advertising_IP" - 169.254.10.100/32 - febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 - "rule-set:LL_TgIP,Skk_TgIP" hosts 与 dns 模块 # hosts模块 hosts: '*.alicia.moe': 127.0.0.1 'alicia.moe': 127.0.0.1 'us3.tls.vlo.cc': 38.246.246.231 'us2.tls.vlo.cc': 154.37.208.14 'tls-us-2.vlo.cc': 38.244.62.224 'tls-us-1.vlo.cc': 154.37.208.14 'cn-09.api.vlo.cc': 38.244.62.224 'cn-05.api.vlo.cc': 154.37.208.14 # dns模块 dns: enable: true cache-algorithm: arc prefer-h3: false use-hosts: true use-system-hosts: false listen: 0.0.0.0:1053 ipv6: false respect-rules: false enhanced-mode: redir-host fake-ip-range: 10.20.0.1/16 default-nameserver: - quic://223.5.5.5 - tls://1.12.12.12 nameserver: - https://cn-05.api.vlo.cc/tls-cx - https://cn-09.api.vlo.cc/tls-cx proxy-server-nameserver: - https://us2.tls.vlo.cc/alicia/m-psn - https://us3.tls.vlo.cc/alicia/m-psn 折腾后记自我感觉，自建 Adguard Home DoH 如果是搭配代理软件使用，可以在代理软件分流。Adguard Home 可以配置不同客户端的上游，这让其在 mihomo 搭配使用时方便很多，毕竟直接在 Adguard Home 分流会很复杂且不易维护如果你也在使用 Adguard Home + Mihomo，也可以尝试这样操作MosDNS-X: github.com GitHub - pmkol/mosdns-x: A high-performance DNS forwarding engine with a...A high-performance DNS forwarding engine with a customizable pipeline. 配置很复杂… 搞这个纯属折腾（确实是很折腾），配置文件抄的 easymosdns 的，然后用 Gemini Pro 网页版又搓了好久的数据面板：https://api.520924.xyz/ 我的 mosdns-X 配置 # EasyMosdns v3.5(Final Release) # https://apad.pro/easymosdns log: file: "./mosdns.log" level: error data_providers: - tag: miaoerwlist file: ./rules/miaoerwlist.txt auto_reload: true - tag: chinalist file: ./rules/china_domain_list.txt auto_reload: true - tag: cnlistA file: ./rules/cnlistA.txt auto_reload: true - tag: cdncn file: ./rules/cdn_domain_list.txt auto_reload: true - tag: cdnnocn file: ./rules/cdn_no_cn.txt auto_reload: true - tag: gfwlist file: ./rules/gfw_domain_list.txt auto_reload: true - tag: gfwlistA file: ./rules/gfwlistA.txt auto_reload: true - tag: chinaip file: ./rules/china_ip_list.txt auto_reload: true - tag: cniplistA file: ./rules/cniplistA.txt auto_reload: true - tag: gfwip file: ./rules/gfw_ip_list.txt auto_reload: true - tag: adlist file: ./rules/ad_domain_list.txt auto_reload: true - tag: miaoerblock file: ./rules/miaoerblock.txt auto_reload: true - tag: ads file: ./rules/ads.txt auto_reload: true - tag: ecscn file: ./ecs_cn_domain.txt auto_reload: true - tag: ecsnoncn file: ./ecs_noncn_domain.txt auto_reload: true - tag: hosts file: ./hosts.txt auto_reload: true plugins: # 数据统计插件 - tag: "metrics_data" type: "metrics_collector" # 广告拦截统计 - tag: "metrics_ad_blocked" type: "metrics_collector" # 本地上游统计 - tag: "metrics_local_up" type: "metrics_collector" # 本地备用上游统计 - tag: "metrics_localB_up" type: "metrics_collector" # 远程上游统计 - tag: "metrics_remote_up" type: "metrics_collector" # 远程备用上游统计 - tag: "metrics_remoteB_up" type: "metrics_collector" # 限制 EDNS0 UDP 缓冲大小的插件 - tag: udp_bufsize_limit type: bufsize args: size: 1232 # 限制为 512 字节，强制大包回落到 TCP # 缓存的插件 # [lan|wan] - tag: cache_lan type: cache args: size: 65536 compress_resp: true #redis: "redis://127.0.0.1:6379/0" lazy_cache_ttl: 86400 cache_everything: true lazy_cache_reply_ttl: 1 - tag: cache_wan type: cache args: size: 131072 compress_resp: true #redis: "redis://127.0.0.1:6379/0" lazy_cache_ttl: 86400 cache_everything: true lazy_cache_reply_ttl: 5 # Hosts的插件 - tag: hosts type: hosts args: hosts: - "provider:hosts" # 获取ECS的插件 - tag: ecs_auto type: ecs args: auto: true force_overwrite: false # 指定ECS的插件 # [local|global] - tag: ecs_local type: ecs args: auto: false ipv4: "101.6.6.0" ipv6: "2001:da8::" force_overwrite: false - tag: ecs_global type: ecs args: auto: false ipv4: "168.95.1.0" ipv6: "2001:b000:168::" force_overwrite: false # 匹配ECS的插件 - tag: ecs_is_local type: query_matcher args: ecs: - "101.6.6.0/24" - "2001:da8::/48" - tag: ecs_is_lan type: query_matcher args: ecs: - "0.0.0.0/8" - "10.0.0.0/8" - "100.64.0.0/10" - "127.0.0.0/8" - "169.254.0.0/16" - "172.16.0.0/12" - "192.0.0.0/24" - "192.0.2.0/24" - "198.18.0.0/15" - "192.88.99.0/24" - "192.168.0.0/16" - "198.51.100.0/24" - "203.0.113.0/24" - "224.0.0.0/3" - "::1/128" - "fc00::/7" - "fe80::/10" - tag: ecs_is_cn type: query_matcher args: ecs: - "provider:chinaip" - "provider:cniplistA" # 调整TTL的插件 # [1m|5m|1h] - tag: ttl_1m type: ttl args: minimal_ttl: 60 maximum_ttl: 3600 - tag: ttl_5m type: ttl args: minimal_ttl: 300 maximum_ttl: 86400 - tag: ttl_1h type: ttl args: minimal_ttl: 3600 maximum_ttl: 86400 # 匹配TYPE12类型请求的插件 - tag: qtype12 type: query_matcher args: qtype: [12] # 匹配TYPE65类型请求的插件 - tag: qtype65 type: query_matcher args: qtype: [65] # 匹配TYPE255类型请求的插件 - tag: qtype255 type: query_matcher args: qtype: [255] # 匹配RCODE2的插件 - tag: response_server_failed type: response_matcher args: rcode: [2] # 屏蔽请求的插件 - tag: black_hole type: blackhole args: rcode: 0 ipv4: "169.254.10.100" ipv6: "febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff" # 匹配无效域名的插件 - tag: query_is_non_domain type: query_matcher args: domain: - "keyword::" # 匹配本地域名的插件 - tag: query_is_local_domain type: query_matcher args: domain: - "provider:chinalist" - "provider:cnlistA" # 匹配污染域名的插件 - tag: query_is_non_local_domain type: query_matcher args: domain: - "provider:gfwlist" - "provider:gfwlistA" # 匹配CDN域名的插件 - tag: query_is_cdn_cn_domain type: query_matcher args: domain: - "provider:cdncn" - tag: query_is_cdn_no_cn_domain type: query_matcher args: domain: - "provider:cdnnocn" # 匹配白名单域名的插件 - tag: query_is_whitelist_domain type: query_matcher args: domain: - "provider:miaoerwlist" # 匹配广告域名的插件 - tag: query_is_ad_domain type: query_matcher args: domain: - "provider:adlist" - "provider:miaoerblock" - "provider:ads" # 匹配强制本地解析域名的插件 - tag: query_is_cn_domain type: query_matcher args: domain: - "provider:ecscn" # 匹配强制非本地解析域名的插件 - tag: query_is_noncn_domain type: query_matcher args: domain: - "provider:ecsnoncn" # 匹配本地IP的插件 - tag: response_has_local_ip type: response_matcher args: ip: - "provider:chinaip" - "provider:cniplistA" # 匹配污染IP的插件 - tag: response_has_gfw_ip type: response_matcher args: ip: - "provider:gfwip" # 转发至本地服务器的插件 - tag: forward_local type: fast_forward args: upstream: - addr: "h3://dns.alidns.com" dial_addr: "223.5.5.5" - addr: "tls://dot.pub" dial_addr: "1.12.12.21" bootstrap: "121.4.4.95" enable_pipeline: true max_conns: 3 # 转发至远程服务器的插件 - tag: forward_remote type: fast_forward args: upstream: - addr: "tls://8.8.8.8" enable_pipeline: true max_conns: 4 - addr: "tls://dns.nextdns.io" bootstrap: "8.8.8.8" enable_pipeline: true max_conns: 4 # 转发至分流服务器的插件 - tag: forward_localReserve type: fast_forward args: upstream: - addr: "quic://dns.alidns.com" dial_addr: "223.6.6.6" - addr: "tls://dot.pub" dial_addr: "1.12.34.56" bootstrap: "121.4.4.95" enable_pipeline: true max_conns: 3 - tag: forward_remoteReserve type: fast_forward args: upstream: - addr: "tls://8.8.4.4" enable_pipeline: true max_conns: 4 - addr: "tls://dns.nextdns.io" bootstrap: "8.8.8.8" enable_pipeline: true max_conns: 4 # 主要的运行逻辑插件 # sequence 插件中调用的插件 tag 必须在 sequence 前定义 # 否则 sequence 找不到对应插件 - tag: main_sequence type: sequence args: exec: - metrics_data # 域名映射IP - hosts # 屏蔽TYPE65与无效类型请求 - if: "[qtype65] || (query_is_non_domain)" exec: - _new_nxdomain_response - _return # 优化PRT与ANY类型请求 - if: "[qtype12] || [qtype255]" exec: - _no_ecs - forward_local - ttl_1h - _return # 缓存ECS - ecs_auto - _edns0_filter_ecs_only - udp_bufsize_limit - if: ecs_is_lan exec: - cache_lan - _no_ecs else_exec: - cache_wan # 强制用本地服务器解析 - if: query_is_cn_domain exec: - forward_local - ttl_5m - _return # 强制用非本地服务器解析 - if: query_is_noncn_domain exec: # 优先返回ipv4结果 - _prefer_ipv4 - ecs_global - primary: # 默认用分流服务器 - forward_remote secondary: # 超时用远程服务器 - forward_remoteReserve fast_fallback: 2500 always_standby: false - ttl_5m - _return # 已知的白名单域名用本地服务器解析 - if: query_is_whitelist_domain exec: # 默认用本地服务器 - metrics_local_up - forward_local - ttl_1m # 预防已知的本地域名临时污染 - if: response_has_gfw_ip exec: - metrics_remote_up - ecs_local - forward_remote - _return # 屏蔽广告域名 - if: query_is_ad_domain exec: - metrics_ad_blocked - black_hole - ttl_1h - _return # 已知的本地域名或CDN域名用本地服务器解析 - if: "(query_is_local_domain) || (query_is_cdn_cn_domain)" exec: # 默认用本地服务器 - metrics_local_up - forward_local - ttl_1m # 预防已知的本地域名临时污染 - if: response_has_gfw_ip exec: - metrics_remote_up - ecs_local - forward_remote - _return # 已知的非大陆CDN域名 - if: query_is_cdn_no_cn_domain exec: # 优先返回ipv4结果 - _prefer_ipv4 - primary: # 默认用分流服务器 - metrics_remote_up - forward_remote secondary: # 超时用远程服务器 - metrics_remoteB_up - forward_remoteReserve fast_fallback: 2500 always_standby: false - ttl_5m - _return # 已知的污染域名用分流服务器或远程服务器解析 - if: query_is_non_local_domain exec: # 优先返回ipv4结果 - _prefer_ipv4 - ecs_global - primary: # 默认用分流服务器 - metrics_remote_up - forward_remote secondary: # 超时用远程服务器 - metrics_remoteB_up - forward_remoteReserve fast_fallback: 2500 always_standby: false - ttl_5m - _return # 剩下的未知域名用IP分流 # 优先返回ipv4结果 - _prefer_ipv4 - primary: # 默认用分流服务器 - metrics_remote_up - ecs_local - forward_remote - if: "(ecs_is_cn) && (response_has_local_ip) || [response_server_failed]" exec: - metrics_localB_up - forward_localReserve - _return secondary: # 超时用本地分流器 - metrics_remote_up - forward_remote - if: response_has_local_ip exec: - metrics_localB_up - forward_localReserve - _return fast_fallback: 2500 always_standby: false - ttl_5m servers: - exec: main_sequence timeout: 10 listeners: - protocol: http addr: "0.0.0.0:9053" url_path: "/tls-cx" get_user_ip_from_header: "X-Forwarded-For" kernel_tx: true kernel_rx: true api: http: "127.0.0.1:9080" 如果需要 mosdns-x 面板文件的，https://api.520924.xyz/mosdns-x-webui.zip 可以下载，根据自己配置文件修改，或者扔给 Gemini 修改搭建的都是 US 服务器，应该都有 9929 线路，可以直连（域名不要搞得像机场域名那种二级域名格式，带 tls、us 这些，可能会被阻断域名）欢迎留言使用体验 我自己是用不出来 Adguard Home 与 Mosdns-x 搭建的在使用上的性能区别，总体还是 Adguard Home 方便📌 转载信息来源： https://linux.do/t/topic/1415535原作者： jiuyue转载时间： 2026/1/7 19:27:00
市面上开源的各种订阅聚合工具挺多的，各有特色，但是涉及到添加中转相关，大多都需要有地方部署后端，或是配置非常复杂，我没找到能满足简单需求的。这个脚本主要面向需求较为简单的用户，比如自己有常用网络环境下的线路鸡，但要访问目标网站有地域限制（比如 AI 不能走香港出口），又希望能从线路鸡中转到各种入口不那么好的机场的用户。脚本的逻辑很简单，就是会添加 LANDING 和 ENTRY 两个节点组。ENTRY 中有上游订阅的所有节点，LANDING 中为上游订阅中的每个节点增加 dialer-proxy: ENTRY，再为其他策略组增加 LANDING 选项。这样只需要在 ENTRY 中选择自己的线路鸡，再点击 LANDING 组的测速按钮，选择落地鸡即可。中转节点和落地节点都可以随时切换。如下图：import yaml from 'js-yaml'; interface Proxy { name: string; [key: string]: unknown; } interface ProxyGroup { name: string; proxies?: string[]; [key: string]: unknown; } interface ClashConfig { proxies?: Proxy[]; 'proxy-groups'?: ProxyGroup[]; [key: string]: unknown; } export default { async fetch(request: Request): Promise<Response> { const url = new URL(request.url); const upstream = url.searchParams.get('url') || '这里修改为你的上游订阅'; try { const res = await fetch(upstream); if (!res.ok) return new Response('Upstream error', { status: 502 }); const text = await res.text(); const config = yaml.load(text) as ClashConfig; if (!config?.proxies) return new Response('Invalid config', { status: 400 }); const proxyNames = config.proxies.map(p => p.name); const landingProxies: Proxy[] = config.proxies.map(p => ({ ...p, name: `${p.name}-landing`, 'dialer-proxy': 'ENTRY' })); config.proxies = [...config.proxies, ...landingProxies]; const entryGroup: ProxyGroup = { name: 'ENTRY', type: 'select', proxies: proxyNames }; const landingGroup: ProxyGroup = { name: 'LANDING', type: 'select', proxies: landingProxies.map(p => p.name) }; const groups = config['proxy-groups'] || []; for (const g of groups) { if (g.proxies) g.proxies.unshift('LANDING'); } config['proxy-groups'] = [entryGroup, landingGroup, ...groups]; return new Response(yaml.dump(config), { headers: { 'Content-Type': 'text/yaml; charset=utf-8' } }); } catch { return new Response('Parse error', { status: 400 }); } } }; 只需要本地在 wrangler 里创建一个空项目，复制以上代码块里的代码，修改代码块里的上游订阅，然后部署即可。📌 转载信息来源： https://linux.do/t/topic/1407482原作者： koast18转载时间： 2026/1/5 15:56:25