mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
ipv6: true
unified-delay: true
tcp-concurrent: true
find-process-mode: strict
global-client-fingerprint: chrome
geodata-mode: true

geox-url:
  geoip: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat"
  geosite: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
  mmdb: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb"

profile:
  store-selected: true
  store-fake-ip: true

dns:
  enable: true
  listen: 0.0.0.0:1053
  ipv6: true
  respect-rules: true
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - "*.lan"
    - "*.local"
    - "*.arpa"
    - "localhost.ptlogin2.qq.com"
    - "msftconnecttest.com"
    - "msftncsi.com"
  default-nameserver:
    - 223.5.5.5
    - 119.29.29.29
  nameserver:
    - https://223.5.5.5/dns-query
    - https://120.53.53.53/dns-query
  proxy-server-nameserver:
    - https://1.1.1.1/dns-query
    - https://8.8.8.8/dns-query
  fallback:
    - https://1.1.1.1/dns-query
    - https://8.8.8.8/dns-query
  fallback-filter:
    geoip: true
    geoip-code: CN
    geosite:
      - gfw

proxies:
  # Source: socks5h://jacobwpeng:pw.hust00@81.71.15.87:57891
  - name: socks5-main
    type: socks5
    server: 81.71.15.87
    port: 57891
    username: jacobwpeng
    password: "pw.hust00"
    udp: true

proxy-groups:
  - name: Proxy
    type: select
    proxies:
      - Auto
      - Fallback
      - socks5-main
      - DIRECT

  - name: Auto
    type: url-test
    url: https://cp.cloudflare.com/generate_204
    interval: 300
    tolerance: 100
    proxies:
      - socks5-main

  - name: Fallback
    type: fallback
    url: https://cp.cloudflare.com/generate_204
    interval: 300
    proxies:
      - socks5-main

  - name: AI
    type: select
    proxies:
      - Proxy
      - Auto
      - socks5-main
      - DIRECT

  - name: Telegram
    type: select
    proxies:
      - Proxy
      - Auto
      - socks5-main

  - name: Streaming
    type: select
    proxies:
      - Proxy
      - Auto
      - socks5-main

  - name: Google
    type: select
    proxies:
      - Proxy
      - Auto
      - socks5-main

  - name: Microsoft
    type: select
    proxies:
      - DIRECT
      - Proxy
      - Auto
      - socks5-main

  - name: Apple
    type: select
    proxies:
      - DIRECT
      - Proxy
      - Auto
      - socks5-main

  - name: Domestic
    type: select
    proxies:
      - DIRECT
      - Proxy
      - Auto

  - name: Final
    type: select
    proxies:
      - Proxy
      - Auto
      - Fallback
      - DIRECT

rules:
  # Basic local/direct rules
  - DOMAIN-SUFFIX,local,DIRECT
  - DOMAIN-SUFFIX,lan,DIRECT
  - DOMAIN,localhost,DIRECT
  - IP-CIDR,127.0.0.0/8,DIRECT,no-resolve
  - IP-CIDR,10.0.0.0/8,DIRECT,no-resolve
  - IP-CIDR,172.16.0.0/12,DIRECT,no-resolve
  - IP-CIDR,192.168.0.0/16,DIRECT,no-resolve

  # China mainland detailed direct rules
  - DOMAIN-SUFFIX,qq.com,Domestic
  - DOMAIN-SUFFIX,wechat.com,Domestic
  - DOMAIN-SUFFIX,weixin.qq.com,Domestic
  - DOMAIN-SUFFIX,qpic.cn,Domestic
  - DOMAIN-SUFFIX,gtimg.cn,Domestic
  - DOMAIN-SUFFIX,taobao.com,Domestic
  - DOMAIN-SUFFIX,tmall.com,Domestic
  - DOMAIN-SUFFIX,alicdn.com,Domestic
  - DOMAIN-SUFFIX,alipay.com,Domestic
  - DOMAIN-SUFFIX,aliyun.com,Domestic
  - DOMAIN-SUFFIX,jd.com,Domestic
  - DOMAIN-SUFFIX,jdcloud.com,Domestic
  - DOMAIN-SUFFIX,pinduoduo.com,Domestic
  - DOMAIN-SUFFIX,bilibili.com,Domestic
  - DOMAIN-SUFFIX,bilivideo.com,Domestic
  - DOMAIN-SUFFIX,iqiyi.com,Domestic
  - DOMAIN-SUFFIX,youku.com,Domestic
  - DOMAIN-SUFFIX,mgtv.com,Domestic
  - DOMAIN-SUFFIX,douyin.com,Domestic
  - DOMAIN-SUFFIX,bytedance.com,Domestic
  - DOMAIN-SUFFIX,xiaohongshu.com,Domestic
  - DOMAIN-SUFFIX,meituan.com,Domestic
  - DOMAIN-SUFFIX,dianping.com,Domestic
  - DOMAIN-SUFFIX,zhihu.com,Domestic
  - DOMAIN-SUFFIX,weibo.com,Domestic
  - DOMAIN-SUFFIX,12306.cn,Domestic
  - DOMAIN-SUFFIX,mi.com,Domestic
  - DOMAIN-SUFFIX,huawei.com,Domestic

  # Service specific routing
  - GEOIP,CN,Domestic,no-resolve

  # Remaining traffic
  - MATCH,Final
