# ---------------------------------------------------
# 基础设置 (基于 Clash Verge Mihomo 内核)
# ---------------------------------------------------
mixed-port: 7897
allow-lan: false
mode: rule
log-level: info
ipv6: true  # 核心：校园网免流必须开启

# Mihomo 内核专用设置
external-controller: '127.0.0.1:9090'
secret: ''
unified-delay: true
tun:
  enable: true
  stack: gvisor
  auto-route: true
  strict-route: false
  auto-detect-interface: true
  dns-hijack:
    - any:53

# ---------------------------------------------------
# DNS 设置 (防污染与IPv6解析必备)
# ---------------------------------------------------
dns:
  enable: true
  ipv6: true
  listen: 0.0.0.0:53
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  default-nameserver:
    - 223.5.5.5
    - 119.29.29.29
  nameserver:
    - https://dns.alidns.com/dns-query
    - https://doh.pub/dns-query
  fallback:
    - https://1.1.1.1/dns-query
    - https://dns.google/dns-query

# ---------------------------------------------------
# 节点配置
# ---------------------------------------------------
proxies:
  - name: "IPv6-免流节点"  # <--- 【统一名称 A】
    type: vmess
    server: "2607:9d00:2000:e5::5b78:b53d"
    port: 54323
    uuid: 6578aa30-54a4-4b7a-a59c-87ee142823fa
    alterId: 0
    cipher: auto
    udp: true
    tls: false
    network: ws
    ws-opts:
      path: /940
      headers:
        # ⚠️ 连接 IPv6 WS 的关键：Host 必须带方括号
        Host: amd.com
  - {"type":"vmess","name":"IPv4","ws-opts":{"path":"/new"},"server":"104.223.59.168","port":54324,"uuid":"318d9d61-cb58-49b4-c83b-c752dd4c92f6","alterId":0,"cipher":"auto","network":"ws"}    

# ---------------------------------------------------
# 策略组
# ---------------------------------------------------
proxy-groups:
  - name: 🚀 节点选择
    type: select
    proxies:
      - "IPv6-免流节点"  # <--- 【必须严格匹配名称 A】
      - "IPv4"
      - DIRECT

# ---------------------------------------------------
# 精简规则
# ---------------------------------------------------
rules:
  # 1. 局域网和私有IP直连
  - IP-CIDR,192.168.0.0/16,DIRECT
  - IP-CIDR,10.0.0.0/8,DIRECT
  - IP-CIDR,172.16.0.0/12,DIRECT
  - IP-CIDR,127.0.0.0/8,DIRECT
  - DOMAIN-SUFFIX,local,DIRECT

  # 2. 校园网/教育网直连 (防止进不去认证网关)
  - DOMAIN-KEYWORD,ustb,DIRECT
  - DOMAIN-SUFFIX,edu.cn,DIRECT

  # 3. 国内网站/IP 直连
  - GEOIP,CN,DIRECT
  - DOMAIN-SUFFIX,cn,DIRECT
  - DOMAIN-KEYWORD,baidu,DIRECT
  - DOMAIN-KEYWORD,alipay,DIRECT
  - DOMAIN-KEYWORD,taobao,DIRECT
  
  # 4. 其余全部走代理
  - MATCH,🚀 节点选择