ipv6: true
unified-delay: true

dns:
  enable: true
  listen: 0.0.0.0:1053
  ipv6: true
  respect-rules: true
  use-hosts: true
  default-nameserver:
    - 223.5.5.5
  nameserver:
    - tls://223.5.5.5
    - tls://223.6.6.6
  proxy-server-nameserver:
    - tls://223.5.5.5
  fallback:
    - tls://1.1.1.1
    - tls://8.8.8.8
  fallback-filter:
    geoip: true
    geoip-code: CN
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - "*"
    - "+.lan"
    - "+.local"
    - "+.stun.*.*"

proxies:
  - name: CAN-4
    type: anytls
    server: cn-can4.access.moecl.com
    port: 10201
    password: b02d695b-818e-4ea9-b493-48399966ace2
    udp: true
    sni: cn-can4.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

  - name: HKG-1M
    type: anytls
    server: cn-szx1.access.moecl.com
    port: 9001
    password: esBRhJawYARo6chId/8uKg==
    udp: true
    sni: hk-hkg1.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

  - name: HKG-2M
    type: anytls
    server: cn-szx1.access.moecl.com
    port: 9031
    password: 3b0a90e9-b083-4d19-881a-4b8db672fb82
    udp: true
    sni: hk-hkg2.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

  - name: HKG-5M
    type: anytls
    server: cn-szx1.access.moecl.com
    port: 9011
    password: 2R33BjYMdGv7NJUssRvmbg==
    udp: true
    sni: hk-hkg5.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

  - name: NRT-1M
    type: anytls
    server: cn-szx1.access.moecl.com
    port: 9021
    password: 20wihTvdz2Cq96EHEFvs3Q==
    udp: true
    sni: jp-nrt1.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

  - name: TPE-1M
    type: anytls
    server: cn-szx1.access.moecl.com
    port: 9041
    password: G4IQ/M/Y9nbqRhOmgoqfgw==
    udp: true
    sni: tw-tpe1.access.moecl.com
    alpn:
      - h2
    client-fingerprint: chrome
    skip-cert-verify: true

proxy-groups:
  - name: Global
    type: select
    proxies:
      - DIRECT
      - REJECT
      - HKG-1M
      - HKG-2M
      - HKG-5M
      - NRT-1M
      - TPE-1M

  - name: China
    type: select
    proxies:
      - DIRECT
      - REJECT
      - Global

  - name: AI
    type: select
    proxies:
      - DIRECT
      - REJECT
      - Global
      - HKG-1M
      - HKG-2M
      - HKG-5M
      - NRT-1M
      - TPE-1M

rule-providers:
  ai_non_ip:
    type: http
    behavior: classical
    format: text
    interval: 43200
    url: https://ruleset.skk.moe/Clash/non_ip/ai.txt
    path: ./sukkaw_ruleset/ai_non_ip.txt
  china_ip:
    type: http
    behavior: ipcidr
    format: text
    interval: 43200
    url: https://ruleset.skk.moe/Clash/ip/china_ip.txt
    path: ./sukkaw_ruleset/china_ip.txt
  local_ip:
    type: http
    behavior: ipcidr
    format: text
    interval: 43200
    url: https://misc-pkgs.moecl.com/subscription/local_ip.txt
    path: ./sukkaw_ruleset/local_ip.txt

rules:
  - RULE-SET,ai_non_ip,AI
  - AND,((DST-PORT,22),(GEOIP,CN)),CAN-4
  - AND,((DST-PORT,3389),(GEOIP,CN)),CAN-4
  - IP-CIDR,100.64.0.0/10,CAN-4
  - DST-PORT,22,HKG-1M
  - DST-PORT,3389,HKG-1M
  - DST-PORT,8006,HKG-1M

  - RULE-SET,china_ip,China
  - MATCH,Global
