# url 里填写自己的订阅,名称不能重复
proxy-providers:
  kscola:
    type: http
    url: "https://substore.entertang.work/wakawakaee/download/collection/noanytls?target=ClashMeta"
    interval: 86400
    path: ./proxies/kscola.yaml
    health-check:
      enable: true
      url: "http://www.apple.com/library/test/success.html"
      interval: 300

proxies:
  - name: "直连"
    type: direct

mode: rule
mixed-port: 7890
ipv6: false
allow-lan: true
unified-delay: true
tcp-concurrent: true
external-controller: 127.0.0.1:9090
external-ui: ui
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"
keep-alive-interval: 30

geodata-mode: true
geodata-loader: standard
geo-auto-update: true
geo-update-interval: 24
geox-url:
  geoip: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip-lite.dat"
  geosite: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
  mmdb: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country-lite.mmdb"
  asn: "https://cdn.jsdelivr.net/gh/xishang0128/geoip@release/GeoLite2-ASN.mmdb"

find-process-mode: strict
global-client-fingerprint: chrome

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

sniffer:
  enable: true
  sniff:
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
    TLS:
      ports: [443, 8443]
  skip-domain:
    - "Mijia Cloud"
    - "+.push.apple.com"

tun:
  enable: true
  stack: mixed
  dns-hijack:
    - "any:53"
    - "tcp://any:53"
  auto-route: true
  auto-redirect: true
  auto-detect-interface: true

dns:
  enable: true
  ipv6: false
  respect-rules: true
  enhanced-mode: fake-ip
  fake-ip-filter:
    - "+.lan"
    - "+.local"
    - "localhost"
    - "+.market.xiaomi.com"
    - "*.stun.*.*"
    - "stun.*.*"
    - "time.*.com"
    - "ntp.*.com"
    - "+.msftconnecttest.com"
    - "+.msftncsi.com"
  nameserver:
    - "https://120.53.53.53/dns-query"
    - "https://223.5.5.5/dns-query"
  proxy-server-nameserver:
    - "https://223.5.5.5/dns-query"
    - "https://1.1.1.1/dns-query"
  nameserver-policy:
    "+.entertang.work":
      - "https://dns.cloudflare.com/dns-query"
      - "https://223.5.5.5/dns-query"
    "rule-set:cn_domain,private_domain":
      - "https://120.53.53.53/dns-query"
      - "https://223.5.5.5/dns-query"
    "rule-set:geolocation-!cn":
      - "https://dns.cloudflare.com/dns-query"
      - "https://dns.google/dns-query"

proxy-groups:
  - name: 默认
    type: select
    proxies: [🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点,直连,自动选择]

  - name: Google
    type: select
    proxies: [🇺🇸美国,🇸🇬新加坡,🇭🇰香港,🇨🇳台湾,🇯🇵日本,全部节点,自动选择]

  - name: Telegram
    type: select
    proxies: [🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇨🇳台湾,🇯🇵日本,全部节点,自动选择]

  - name: Twitter
    type: select
    proxies: [🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇨🇳台湾,🇯🇵日本,全部节点,自动选择]

  - name: StreamMedia
    type: select
    proxies: [🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇯🇵日本,🇨🇳台湾,默认]

  - name: YouTube
    type: select
    proxies: [🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇨🇳台湾,🇯🇵日本,全部节点,自动选择,直连]

  - name: Amazon
    type: select
    proxies: [默认,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点,自动选择,直连]

  - name: Github
    type: select
    proxies: [默认,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点,自动选择,直连]

  - name: OpenAI
    type: select
    proxies: [🇺🇸美国,🇯🇵日本,🇸🇬新加坡,🇨🇳台湾,默认,自动选择]

  - name: Microsoft
    type: select
    proxies: [默认,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点,自动选择,直连]

  - name: Copilot
    type: select
    proxies: [默认,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点,自动选择,直连]

  - name: 新闻流媒体
    type: select
    proxies: [默认,🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇨🇳台湾,🇯🇵日本]

  - name: 国内
    type: select
    proxies: [直连,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点]

  - name: 下载
    type: select
    proxies: [直连,🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,全部节点]

  - name: 其他
    type: select
    proxies: [🇸🇬新加坡,🇺🇸美国,🇭🇰香港,🇨🇳台湾,🇯🇵日本,全部节点,自动选择,直连]

  - name: 国内网盘
    type: select
    proxies: [直连,🇭🇰香港,🇨🇳台湾,🇸🇬新加坡,🇯🇵日本,🇺🇸美国,全部节点]

  - name: 资源站
    type: select
    proxies: [🇭🇰香港,🇨🇳台湾,🇯🇵日本,🇸🇬新加坡,🇺🇸美国,直连,自动选择,默认,全部节点]

  # 地区分组
  - name: 🇭🇰香港
    type: url-test
    include-all-providers: true
    filter: "(?i)港|香港|hk|hong\\s?kong"
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 50
    lazy: true

  - name: 🇨🇳台湾
    type: url-test
    include-all-providers: true
    filter: "(?i)台|台湾|taiwan|(^|[^a-z])tw([^a-z]|$)"
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 50
    lazy: true

  - name: 🇯🇵日本
    type: url-test
    include-all-providers: true
    filter: "(?i)日本|japan|(^|[^a-z])jp([^a-z]|$)"
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 50
    lazy: true

  - name: 🇺🇸美国
    type: url-test
    include-all-providers: true
    filter: "(?i)美|美国|united\\s?states|(^|[^a-z])usa([^a-z]|$)|(^|[^a-z])us([^a-z]|$)"
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 50
    lazy: true

  - name: 🇸🇬新加坡
    type: url-test
    include-all-providers: true
    filter: "(?i)新加坡|singapore|(^|[^a-z])sg([^a-z]|$)"
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 50
    lazy: true

  - name: 全部节点
    type: select
    include-all: true
    exclude-filter: 直连

  - name: 自动选择
    type: url-test
    include-all: true
    exclude-filter: 直连
    url: "http://www.apple.com/library/test/success.html"
    interval: 300
    tolerance: 10

rules:
  - RULE-SET,private_ip,直连,no-resolve
  - RULE-SET,wifi_uk_call,直连,no-resolve
  - DOMAIN-SUFFIX,entertang.work,直连

  # 国内网盘 / 资源
  - RULE-SET,115_domain,国内网盘
  - RULE-SET,123_domain,国内网盘
  - RULE-SET,189_domain,国内网盘
  - RULE-SET,139_domain,国内网盘

  - RULE-SET,leijingpanta_domain,资源站
  - RULE-SET,pikpak_domain,下载
  - RULE-SET,docker_domain,下载

  # 流媒体 / 社交 / AI（需在 cn / geolocation 之前）
  - RULE-SET,spotify_domain,其他
  - RULE-SET,tmdb_domain,StreamMedia
  - RULE-SET,netflix_domain,StreamMedia
  - RULE-SET,youtube_domain,YouTube
  - RULE-SET,twitter_domain,Twitter
  - RULE-SET,telegram_domain,Telegram
  - RULE-SET,google_domain,Google
  - RULE-SET,amazon_domain,Amazon
  - RULE-SET,github_domain,Github
  - RULE-SET,copilot_domain,Copilot
  - RULE-SET,openai_domain,OpenAI
  - RULE-SET,microsoft_domain,Microsoft
  - RULE-SET,cnn_domain,新闻流媒体
  - RULE-SET,abc_domain,新闻流媒体
  - RULE-SET,bbc_domain,新闻流媒体

  - RULE-SET,cn_domain,国内
  - RULE-SET,gfw_domain,其他
  - RULE-SET,geolocation-!cn,其他

  - RULE-SET,telegram_ip,Telegram,no-resolve
  - RULE-SET,google_ip,Google,no-resolve
  - RULE-SET,twitter_ip,Twitter,no-resolve
  - RULE-SET,netflix_ip,StreamMedia,no-resolve
  - RULE-SET,cn_ip,国内,no-resolve
  - GEOIP,CN,国内,no-resolve
  - MATCH,其他

rule-anchor:
  ip: &ip {type: http, interval: 86400, behavior: ipcidr, format: text}
  domain: &domain {type: http, interval: 86400, behavior: domain, format: text}
  classical: &classical {type: http, interval: 86400, behavior: classical, format: text}

rule-providers:
  private_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/private.list"
  cn_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.list"
  amazon_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/amazon.list"
  copilot_domain:
    <<: *classical
    url: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Copilot/Copilot.list"
  github_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/github.list"
  twitter_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/twitter.list"
  netflix_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/netflix.list"
  spotify_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/spotify.list"
  youtube_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/youtube.list"
  google_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/google.list"
  telegram_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/telegram.list"
  openai_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/openai.list"
  microsoft_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/microsoft.list"
  geolocation-!cn:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/geolocation-!cn.list"
  gfw_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/gfw.list"
  pikpak_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/pikpak.list"
  115_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/115.list"
  123_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/liubin21/clash_rules/main/123.list"
  189_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/liubin21/clash_rules/main/189.list"
  139_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/liubin21/clash_rules/main/139.list"
  leijingpanta_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/liubin21/clash_rules/main/leijing_panta.list"
  tmdb_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/tmdb.list"
  docker_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/docker.list"
  bbc_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bbc.list"
  abc_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/abc.list"
  cnn_domain:
    <<: *classical
    url: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/CNN/CNN.list"
  wifi_uk_call:
    <<: *classical
    url: "https://raw.githubusercontent.com/iniwex5/tools/main/rules/UK-wifi-call.list"

  private_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/private.list"
  cn_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/cn.list"
  google_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/google.list"
  netflix_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/netflix.list"
  twitter_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/twitter.list"
  telegram_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/telegram.list"
