mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
ipv6: false

dns:
  enable: true
  ipv6: false
  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
  follow-rule: false
  nameserver-policy:
    "+.openai.com": "https://dns.alidns.com/dns-query"
    "+.chatgpt.com": "https://dns.alidns.com/dns-query"
    "+.oaistatic.com": "https://dns.alidns.com/dns-query"
    "+.oaiusercontent.com": "https://dns.alidns.com/dns-query"
  fake-ip-filter:
    - "*.lan"
    - "+.local"
    - "localhost.ptlogin2.qq.com"
    - "+.stun.*.*"
    - "+.stun.*.*.*"
    - "+.stun.*.*.*.*"
    - "+.stun.*.*.*.*.*"

proxies:
  - name: rack-vless-reality
    type: vless
    server: rack.mise.fun
    port: 8443
    uuid: be882002-b13a-4f91-940e-1034b6ee6cb2
    flow: xtls-rprx-vision
    network: tcp
    udp: true
    tls: true
    sni: www.cloudflare.com
    client-fingerprint: chrome
    reality-opts:
      public-key: k0SAAZNHlJIGbbxjwPgVKLXE1xcqyo46pGbXgrvDm2I
      short-id: 3c5125356cc59953

proxy-groups:
  - name: PROXY
    type: select
    proxies:
      - rack-vless-reality
      - DIRECT

rule-providers:
  ads:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/ads.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/category-ads-all.yaml
    interval: 86400
  private-domain:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/private-domain.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/private.yaml
    interval: 86400
  apple-cn:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/apple-cn.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/apple-cn.yaml
    interval: 86400
  microsoft-cn:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/microsoft-cn.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/microsoft@cn.yaml
    interval: 86400
  telegram-domain:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/telegram-domain.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/telegram.yaml
    interval: 86400
  geolocation-not-cn:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/geolocation-not-cn.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/geolocation-!cn.yaml
    interval: 86400
  cn-domain:
    type: http
    behavior: domain
    format: yaml
    path: ./ruleset/cn-domain.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/cn.yaml
    interval: 86400
  private-ip:
    type: http
    behavior: ipcidr
    format: yaml
    path: ./ruleset/private-ip.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/private.yaml
    interval: 86400
  telegram-ip:
    type: http
    behavior: ipcidr
    format: yaml
    path: ./ruleset/telegram-ip.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/telegram.yaml
    interval: 86400
  cn-ip:
    type: http
    behavior: ipcidr
    format: yaml
    path: ./ruleset/cn-ip.yaml
    url: https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geoip/cn.yaml
    interval: 86400

rules:
  - RULE-SET,ads,REJECT
  - DOMAIN-SUFFIX,openai.com,PROXY
  - DOMAIN-SUFFIX,chatgpt.com,PROXY
  - DOMAIN-SUFFIX,oaistatic.com,PROXY
  - DOMAIN-SUFFIX,oaiusercontent.com,PROXY
  - RULE-SET,private-domain,DIRECT
  - RULE-SET,apple-cn,DIRECT
  - RULE-SET,microsoft-cn,DIRECT
  - RULE-SET,telegram-domain,PROXY
  - RULE-SET,geolocation-not-cn,PROXY
  - RULE-SET,cn-domain,DIRECT
  - RULE-SET,private-ip,DIRECT,no-resolve
  - RULE-SET,telegram-ip,PROXY,no-resolve
  - RULE-SET,cn-ip,DIRECT,no-resolve
  - MATCH,PROXY

