From 11ed257b2b29df4213556efc65708c484c8d4778 Mon Sep 17 00:00:00 2001 From: nite Date: Sat, 4 Jul 2026 02:00:18 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8C/=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clash-template.yaml | 203 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 clash-template.yaml diff --git a/clash-template.yaml b/clash-template.yaml new file mode 100644 index 0000000..8117fc7 --- /dev/null +++ b/clash-template.yaml @@ -0,0 +1,203 @@ +mode: rule +mixed-port: 7900 +allow-lan: true +log-level: info +ipv6: true +unified-delay: true +external-controller: 0.0.0.0:9090 +tcp-concurrent: true +allow-origins: + - "*" +allow-private-network: true +find-process-mode: always +geo-auto-update: true +geox-url: + geoip: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat" + geosite: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat" + mmdb: "https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb" + asn: "https://github.com/xishang0128/geoip/releases/download/latest/GeoLite2-ASN.mmdb" +dns: + enable: true + ipv6: true + listen: 0.0.0.0:1053 + enhanced-mode: fake-ip + cache-algorithm: arc + nameserver: + - https://dns.alidns.com/dns-query + - https://doh.pub/dns-query + proxy-server-nameserver: + - 223.5.5.5 + - 119.29.29.29 + nameserver-policy: + "geosite:cn,steam@cn,category-games@cn,private": + - 223.5.5.5 + - 119.29.29.29 + "+.nite07.com": + - 223.5.5.5 + - 119.29.29.29 + "geoip:cn": + - 223.5.5.5 + - 119.29.29.29 + "domain-keyword:stun": + - 223.5.5.5 + - 119.29.29.29 + fake-ip-filter: + # easytier 使用域名 + - "+.nite07.com" + + # --- 本地服务发现 --- + - "*.lan" + - "*.local" + - "*.home.arpa" + - "*.localhost" + + # --- 连通性探测 (解决 Windows/Android 显示"无网络连接") --- + - "+.msftconnecttest.com" + - "+.msftncsi.com" + - "dns.msftncsi.com" + - "ping.archlinux.org" + - "ipv6.archlinux.org" + + # --- 游戏与 STUN (关键:解决 NAT 类型严格问题) --- + - "+.stun.*" + - "stun.*" + - "+.stun.playstation.net" + - "xbox.*.microsoft.com" + - "*.*.xboxlive.com" + - "+.battlenet.com.cn" + - "+.uu.163.com" + - "+.uu.netease.com" + + # --- NTP 时间同步 --- + - "time.*.com" + - "ntp.*.com" + - "+.pool.ntp.org" + +sniffer: + enable: false + parse-pure-ip: true # 即使是对 IP 的请求也尝试嗅探域名 [9] + force-dns-mapping: true # 强制检查映射表 + override-destination: true # 如果嗅探出的域名解析结果与原目标 IP 不符,重定向到新 IP + sniff: + HTTP: + ports: [80, 8080-8880] + TLS: + ports: [443, 8443] + QUIC: + ports: [443, 8443] + +tun: + enable: false + stack: system + auto-route: true + strict-route: false + auto-detect-interface: true + endpoint-independent-nat: true + dns-hijack: + - any:53 + exclude-interface: + - tun163 + - tun0 +profile: + store-selected: true + store-fake-ip: true +proxy-groups: + - name: 节点选择 + type: select + proxies: + - + - 手动切换 + - DIRECT + - name: 手动切换 + type: select + proxies: + - + - type: select + name: Proton + proxies: + - DIRECT + - 节点选择 + - + - 手动切换 + lazy: false + - type: select + name: Steam 游戏(原生) + proxies: + - DIRECT + - 节点选择 + - + - 手动切换 + lazy: false + - type: select + name: 游戏平台(中国) + proxies: + - DIRECT + - 节点选择 + - + - 手动切换 + lazy: false + - type: select + name: 游戏平台(全球) + proxies: + - 节点选择 + - + - 手动切换 + - DIRECT + lazy: false + - type: select + name: 漏网之鱼 + proxies: + - 节点选择 + - + - 手动切换 + - DIRECT + lazy: false + - type: select + name: 广告屏蔽 + proxies: + - REJECT + - DIRECT + lazy: false +rule-providers: + AWAvenue: + type: http + behavior: domain + format: yaml + path: ./rule_providers/AWAvenue-Ads-Rule-Clash.yaml + url: "https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main/Filters/AWAvenue-Ads-Rule-Clash.yaml" + interval: 86400 +rules: + # 阻断 443 udp (quic) 连接,如果不阻断会导致浏览器尝试通过 quic 访问一些站点,udp 代理效果不佳则会导致页面加载缓慢 + - AND,((NETWORK,UDP),(DST-PORT,443)),REJECT + # easytier + - DST-PORT,11010,DIRECT + - IP-CIDR,10.10.10.0/24,DIRECT,no-resolve + # stun + - AND,((NETWORK,UDP),(DST-PORT,3478)),DIRECT + # 私有网络 + - GEOIP,private,DIRECT,no-resolve + - GEOIP,lan,DIRECT,no-resolve + # 广告 + - RULE-SET,AWAvenue,广告屏蔽 + - DOMAIN,headscale.nite07.com,DIRECT + - DOMAIN,voice.nite07.com,DIRECT + # - DOMAIN-SUFFIX,online-fix.me,台湾(TW) + # Wine/Proton 游戏 + - PROCESS-PATH-REGEX,(?i).*[\\/]steam[\\/]compatibilitytools\.d[\\/].*,Proton + # 原生游戏 + - PROCESS-PATH-REGEX,(?i).*[\\/]steamapps[\\/]common[\\/].*,Steam 游戏(原生) + - GEOSITE,steam@cn,游戏平台(中国) + - GEOSITE,steam,游戏平台(全球) + - GEOSITE,category-games@cn,游戏平台(中国) + - GEOSITE,category-games,游戏平台(全球) + - GEOSITE,google,节点选择 + - GEOSITE,youtube,节点选择 + - GEOSITE,telegram,节点选择 + - GEOSITE,github,节点选择 + - GEOSITE,netflix,节点选择 + - GEOSITE,gfw,节点选择 + - GEOSITE,CN,DIRECT + - GEOSITE,geolocation-!cn,节点选择 + - GEOIP,google,节点选择 + - GEOIP,CN,DIRECT + - MATCH,漏网之鱼