port: 7890
socks-port: 7891
# 需要打开，否则只有运行 Clash 的这台设备自己能上网
allow-lan: true
mode: rule
log-level: info
ipv6: false
interrupt-exist-connections: false

# ================= 零泄露专属 DNS 模块 =================
dns:
  enable: true
  listen: 0.0.0.0:1053
  ipv6: false
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - "*.lan"
    - "*.local"
    - "localhost.ptlogin2.qq.com"
    - "+.msftconnecttest.com"
    - "+.msftncsi.com"
    - "+.pool.ntp.org"
    - "time*.windows.com"
    - "time*.apple.com"
  proxy-server-nameserver:
    - 223.5.5.5
  default-nameserver:
    - 223.5.5.5
  nameserver:
    - 223.5.5.5
    - 119.29.29.29

# ================= 固定专属节点 =================
proxies:
  # ================= Cloudflare Tunnel 专属节点集群 =================
  - name: "🇺🇸 cft 🇭🇰"
    type: vless
    server: 104.18.11.128
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cft 🇭🇰 2"
    type: vless
    server: 104.19.152.180
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cft 🇺🇸 (洛杉矶)"
    type: vless
    server: 198.41.214.141
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
    type: vless
    server: 104.21.199.133
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cft 🇺🇸 (西雅图)"
    type: vless
    server: 104.21.17.55
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cf.090227.xyz"
    type: vless
    server: cf.090227.xyz
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 cmcc.hw.090227.xyz"
    type: vless
    server: cmcc.hw.090227.xyz
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  - name: "🇺🇸 node.jaydentune.top"
    type: vless
    server: node.jaydentune.top
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: ws
    tls: true
    udp: true
    servername: node.jaydentune.top
    client-fingerprint: chrome
    ws-opts:
      path: "/ray"
      headers:
        Host: node.jaydentune.top

  # ================= Reality 节点集合 =================
  - name: "🇺🇸 Reality 直连"
    type: vless
    server: 107.172.214.195
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: tcp
    tls: true
    udp: true
    flow: xtls-rprx-vision
    servername: academy.nvidia.com
    reality-opts:
      public-key: jK8yu9AMtNQ4J_uKE1inAzJr6V5J4GNK3sAN6nZBbUo
      short-id: 6ba85179e30d4fc2
    client-fingerprint: chrome

  - name: "🇺🇸 Reality 链式"
    type: vless
    server: 107.172.214.195
    port: 443
    uuid: 2af77824-f83d-4f50-9dd0-560bb6e7cd45
    network: tcp
    tls: true
    udp: true
    flow: xtls-rprx-vision
    servername: academy.nvidia.com
    reality-opts:
      public-key: jK8yu9AMtNQ4J_uKE1inAzJr6V5J4GNK3sAN6nZBbUo
      short-id: 6ba85179e30d4fc2
    client-fingerprint: chrome
    dialer-proxy: "⚡ 飞鸟云-自动优选"


# ================= 动态订阅提供商 (飞鸟云) =================
# 只要 Clash 点击更新，就会自动从你的订阅拉取最新节点，永不过期
proxy-providers:
  feiniao:
    type: http
    url: "https://34584224.908970.xyz/api/v1/client/subscribe?token=92723de54c6e734ccfd43d28351f9eb0"
    path: ./providers/feiniao.yaml
    interval: 86400
    health-check:
      enable: true
      interval: 300
      url: http://cp.cloudflare.com/generate_204

# ================= 策略组 =================
proxy-groups:
  # 客户端主界面主控：一键切换使用 Reality 套件、Hysteria 2 套件 或 飞鸟云
  - name: "RackNerd VPS 🇺🇸"
    type: select
    proxies:
      - "⚡ 自动优选"
      - "⚡ sw-自动选择"
      - "⚡ Reality 自动选择"
      - "⚡ 公司专用"
      - "🛡️ 故障转移"
      - "🇺🇸 Reality 直连"
      - "🇺🇸 Reality 链式"
      - "🇺🇸 cft 🇭🇰"
      - "🇺🇸 cft 🇭🇰 2"
      - "🇺🇸 cft 🇺🇸 (洛杉矶)"
      - "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
      - "🇺🇸 cft 🇺🇸 (西雅图)"
      - "🇺🇸 cf.090227.xyz"
      - "🇺🇸 cmcc.hw.090227.xyz"
      - "🇺🇸 node.jaydentune.top"
      - "🇺🇸 🛡️宿舍路由器专用"

  - name: "⚡ 公司专用"
    type: url-test
    url: http://cp.cloudflare.com/generate_204
    interval: 90
    tolerance: 40
    hidden: true
    lazy: true
    timeout: 2500
    proxies:
      - "🇺🇸 Reality 直连"
      - "🇺🇸 cft 🇭🇰"
      - "🇺🇸 cft 🇭🇰 2"
      - "🇺🇸 cft 🇺🇸 (洛杉矶)"
      - "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
      - "🇺🇸 cft 🇺🇸 (西雅图)"
      - "🇺🇸 cf.090227.xyz"
      - "🇺🇸 cmcc.hw.090227.xyz"
      - "🇺🇸 node.jaydentune.top"


  - name: "🇺🇸 🛡️宿舍路由器专用"
    type: url-test
    url: http://cp.cloudflare.com/generate_204
    interval: 60
    tolerance: 40
    hidden: true
    lazy: true
    timeout: 2500
    proxies:
      - "🇺🇸 cft 🇭🇰"
      - "🇺🇸 cft 🇭🇰 2"
      - "🇺🇸 cft 🇺🇸 (洛杉矶)"
      - "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
      - "🇺🇸 cft 🇺🇸 (西雅图)"
      - "🇺🇸 cf.090227.xyz"
      - "🇺🇸 cmcc.hw.090227.xyz"
      - "🇺🇸 node.jaydentune.top"


  # 隧道自动优选组：定期跑分测速，始终自动挑选延迟最低的优质节点（接受跳连接）
  - name: "⚡ 自动优选"
    type: url-test
    url: http://cp.cloudflare.com/generate_204
    interval: 120
    tolerance: 40
    hidden: true
    timeout: 2500
    lazy: true
    proxies:
      # 简化写法
      - "⚡ sw-自动选择"
      - "⚡ Reality 自动选择"

  # 隧道自动优选组：定期跑分测速，始终自动挑选延迟最低的优质节点（接受跳连接）
  - name: "⚡ sw-自动选择"
    type: url-test
    url: http://cp.cloudflare.com/generate_204
    interval: 90
    tolerance: 40
    hidden: true
    timeout: 2500
    lazy: true
    proxies:
      - "🇺🇸 cft 🇭🇰"
      - "🇺🇸 cft 🇭🇰 2"
      - "🇺🇸 cft 🇺🇸 (洛杉矶)"
      - "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
      - "🇺🇸 cft 🇺🇸 (西雅图)"
      - "🇺🇸 cf.090227.xyz"
      - "🇺🇸 cmcc.hw.090227.xyz"
      - "🇺🇸 node.jaydentune.top"

  # 2. 全局故障转移组：严格按顺序排列，平时死死走最快的主力不跳连接，断线才顺延降级
  - name: "🛡️ 故障转移"
    type: fallback
    url: http://cp.cloudflare.com/generate_204
    interval: 90
    hidden: true
    lazy: true
    proxies:
      - "🇺🇸 Reality 直连"
      - "🇺🇸 cft 🇭🇰"
      - "🇺🇸 cft 🇭🇰 2"
      - "🇺🇸 cft 🇺🇸 (洛杉矶)"
      - "🇺🇸 cft 🇺🇸 (洛杉矶 2)"
      - "🇺🇸 cft 🇺🇸 (西雅图)"
      - "🇺🇸 Reality 链式"
      - "🇺🇸 cf.090227.xyz"
      - "🇺🇸 cmcc.hw.090227.xyz"
      - "🇺🇸 node.jaydentune.top"


  # Reality 专属双节点自动优选池
  - name: "⚡ Reality 自动选择"
    type: url-test
    url: http://cp.cloudflare.com/generate_204
    interval: 90
    tolerance: 40
    lazy: true
    hidden: true
    proxies:
      - "🇺🇸 Reality 链式"
      - "🇺🇸 Reality 直连"

    # 飞鸟云独立自动优选
  - name: "飞鸟云"
    type: select
    use:
      - feiniao

    # 飞鸟云-全部节点自动优选
  - name: "⚡ 飞鸟云-自动优选"
    type: url-test
    lazy: true
    url: http://cp.cloudflare.com/generate_204
    interval: 90
    tolerance: 40
    timeout: 2500
    hidden: true
    use:
      - feiniao
    filter: "日本|美国|台湾"

# ================= 路由分流规则 =================

# 1. 声明远程规则集（由社区大佬 LoyalSoldier 维护，每天自动更新）
rule-providers:
  # 广告拦截（可选，不需要可以删掉）
  reject:
    type: http
    behavior: domain
    url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
    path: ./ruleset/reject.yaml
    interval: 86400

  # 局域网直连
  lancidr:
    type: http
    behavior: ipcidr
    url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
    path: ./ruleset/lancidr.yaml
    interval: 86400

  # 国外被墙网站 / 常用代理域名
  proxy:
    type: http
    behavior: domain
    url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
    path: ./ruleset/proxy.yaml
    interval: 86400

  # 国内主流域名（极其全，覆盖所有国内大厂、APP、服务）
  direct:
    type: http
    behavior: domain
    url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
    path: ./ruleset/direct.yaml
    interval: 86400

  # 国内 IP 段（兜底解析后是国内 IP 的网站）
  cncidr:
    type: http
    behavior: ipcidr
    url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
    path: ./ruleset/cncidr.yaml
    interval: 86400

# 2. 规则匹配（非常清爽，只用写几行）
rules:
  # 1. 封杀浏览器内置安全 DNS (DoH 金丝雀域名)，禁止 Chrome/Edge 绕过代理
  - DOMAIN,use-application-dns.net,REJECT

  # 2. 机场订阅域名直连
  - DOMAIN,34584224.908970.xyz,DIRECT

  # 3. 局域网直连 (加 no-resolve 避免本地解析)
  - RULE-SET,lancidr,DIRECT,no-resolve
  - GEOIP,LAN,DIRECT,no-resolve

  # 4. 广告拦截
  - RULE-SET,reject,REJECT

  # 5. 国外域名走代理 (走你的美国节点)
  - RULE-SET,proxy,RackNerd VPS 🇺🇸

  # 6. 国内主流域名直连 (覆盖国内几乎所有常见大厂与应用)
  - RULE-SET,direct,DIRECT

  # 7. 国内 IP 直连 (加 no-resolve 堵死冷门未知域名的本地泄漏漏洞)
  - RULE-SET,cncidr,DIRECT,no-resolve
  - GEOIP,CN,DIRECT,no-resolve

  # 8. 兜底：其余未匹配到的冷门/国外服务，统统走美国节点远端解析
  - MATCH,RackNerd VPS 🇺🇸