mixed-port: 7891
redir-port: 7892
tproxy-port: 7893
allow-lan: true
mode: Rule
log-level: warning
external-controller: 0.0.0.0:9091
ipv6: false
unified-delay: true
tcp-concurrent: true
geodata-mode: true
geodata-loader: memconservative
dns:
    enable: true
    listen: '0.0.0.0:1053'
    enhanced-mode: fake-ip
    default-nameserver: [223.5.5.5, 119.29.29.29, 114.114.114.114]
    nameserver: ['https://dns.alidns.com/dns-query', 'https://doh.pub/dns-query']
    fake-ip-filter: [ '+.smartx.com', '+.smtx.io', '+.smtx.tech', '+.smtx.fun', '+.gitgo.cc', '*.lan', '*.linksys.com', '*.linksyssmartwifi.com', swscan.apple.com, mesu.apple.com, swquery.apple.com, swdownload.apple.com, swcdn.apple.com, swdist.apple.com, '*.msftconnecttest.com', '*.msftncsi.com', 'xbox.*.microsoft.com', 'xbox.*.*.microsoft.com', +.xboxlive.com, 'time.*.com', 'time.*.gov', 'time.*.edu.cn', 'time.*.apple.com', 'time1.*.com', 'time2.*.com', 'time3.*.com', 'time4.*.com', 'time5.*.com', 'time6.*.com', 'time7.*.com', 'ntp.*.com', 'ntp.*.com', 'ntp1.*.com', 'ntp2.*.com', 'ntp3.*.com', 'ntp4.*.com', 'ntp5.*.com', 'ntp6.*.com', 'ntp7.*.com', '*.time.edu.cn', '*.ntp.org.cn', +.pool.ntp.org, time1.cloud.tencent.com, lens.l.google.com, +.music.163.com, +.126.net, musicapi.taihe.com, music.taihe.com, songsearch.kugou.com, trackercdn.kugou.com, '*.kuwo.cn', api-jooxtt.sanook.com, api.joox.com, joox.com, +.y.qq.com, +.music.tc.qq.com, aqqmusic.tc.qq.com, +.stream.qqmusic.qq.com, +.xiami.com, +.music.migu.cn, '+.stun.*.*', '+.stun.*.*.*', '+.stun.*.*.*.*', '+.stun.*.*.*.*.*', +.srv.nintendo.net, '*.n.n.srv.nintendo.net', +.stun.playstation.net, +.battlenet.com.cn, +.wotgame.cn, +.wggames.cn, +.wowsgame.cn, +.wargaming.net, '*.square-enix.com', '*.finalfantasyxiv.com', '*.ffxiv.com', '*.ff14.sdo.com', ff.dorado.sdo.com, localhost.ptlogin2.qq.com, localhost.sec.qq.com, +.qq.com, +.baidu.com, +.163.com, +.126.net, +.taobao.com, +.jd.com, +.tmall.com, '*.mcdn.bilivideo.cn', +.nvidia.com, +.nvidia.cn, +.nvgs.nvidia.com, +.nvgs.nvidia.cn, shark007.net]

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

proxies: []

proxy-providers:
  idc3:
    type: http
    url: "http://192.168.31.215/smartx/idc3.yaml"
    interval: 600
    health-check:
      enable: true
      interval: 600
      url: https://www.google.com/generate_204
  idc4:
    type: http
    url: "http://192.168.31.215/smartx/idc4.yaml"
    interval: 600
    health-check:
      enable: true
      interval: 600
      url: https://www.google.com/generate_204
  idc5:
    type: http
    url: "http://192.168.31.215/smartx/idc5.yaml"
    interval: 600
    health-check:
      enable: true
      interval: 600
      url: https://www.google.com/generate_204

proxy-groups:
  - name: GLOBAL
    type: select
    proxies:
      - 美国
      - Proxy
      - DIRECT

  - name: Proxy
    type: url-test
    url: https://www.google.com/generate_204
    interval: 600
    use: [idc5, idc4, idc3]
    filter: "(?i)日本|JP|Japan|新加坡|SG|Singapore|美国|US|States"
    tolerance: 100

  - name: "Google&Gemini"
    type: fallback
    url: https://www.google.com/generate_204
    interval: 300
    timeout: 600
    use: [idc4, idc5]
    #filter: "(?i)日本|JP|Japan|新加坡|SG|Singapore|美国|US|States"

  - name: Gmail
    type: fallback
    url: https://www.google.com/generate_204
    interval: 300
    timeout: 600
    use: [idc5]
    #filter: "(?i)DMIT"

  - name: GitHub
    type: fallback
    use: [idc4,idc5]
    url: https://www.google.com/generate_204
    interval: 300
    timeout: 600

  - name: Docker
    type: fallback
    use: [idc5,idc4]
    #filter: "(?i)新加坡|SG|Singapore|美国|US|States"
    url: https://www.google.com/generate_204
    interval: 300
    timeout: 600

  - name: 美国
    #type: url-test
    #strategy: round-robin
    type: fallback
    use: [idc5]
    url: https://www.google.com/generate_204
    interval: 300
    timeout: 600
    filter: "(?i)美国|US|States"


rule-providers:
  ai-rules:
    type: http
    behavior: classical
    url: "http://192.168.31.215/ai_rules.yaml"
    path: ./ruleset/ai_rules.yaml
    interval: 86400
  google-rules:
    type: http
    behavior: classical
    url: "http://192.168.31.215/google_rules.yaml"
    path: ./ruleset/google_rules.yaml
    interval: 86400
  gmail-rules:
    type: http
    behavior: classical
    url: "http://192.168.31.215/gmail_rules.yaml"
    path: ./ruleset/gmail_rules.yaml
    interval: 86400


rules:
  # === 1. 特殊例外规则 (必须放在通用规则之前) ===
  - DOMAIN,apps.apple.com,美国

  # === 2. 公司、私有服务与内网 (直连) ===
  - DOMAIN-KEYWORD,smtx,DIRECT
  - DOMAIN-SUFFIX,smartx.com,DIRECT
  - DOMAIN-SUFFIX,gitgo.cc,DIRECT
  - DOMAIN-SUFFIX,local,DIRECT
  - DOMAIN,idt-shared-2108843223.us-east-1.elb.amazonaws.com,DIRECT
  - GEOSITE,private,DIRECT

  # === 3. AI 服务 ===
  - DOMAIN-SUFFIX,anthropic.com,美国
  - DOMAIN-SUFFIX,claude.ai,美国
  - DOMAIN-SUFFIX,claude.com,美国
  - DOMAIN-SUFFIX,talkischeap.cloud,美国
  - IP-CIDR,108.92.19.157/32,美国
  - RULE-SET,ai-rules,美国
  - DOMAIN-KEYWORD,slack,美国

  # === 4. 国际流媒体与服务 (代理) ===
  - GEOSITE,youtube,Proxy
  - GEOSITE,telegram,Proxy
  - GEOSITE,github,GitHub
  - GEOSITE,docker,Docker
  - RULE-SET,gmail-rules,Gmail
  - GEOSITE,google,Google&Gemini
  - RULE-SET,google-rules,Google&Gemini

  # === 5. 国内服务与局域网 IP (直连) ===
  - GEOSITE,cn,DIRECT
  - GEOIP,CN,DIRECT
  - 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
  - IP-CIDR,100.64.0.0/10,DIRECT

  # === 6. 最终兜底 ===
  - MATCH,Proxy
