# ================= ͨ����������� =================
log-level: warning
mode: rule
ipv6: false
mixed-port: 7890
allow-lan: true
bind-address: "*"
lan-allowed-ips:
  - 0.0.0.0/0
find-process-mode: strict
external-controller: 0.0.0.0:9090

tcp-concurrent: true
keep-alive-interval: 15
client-fingerprint: chrome

geox-url:
  geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
  geosite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
  mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb"
geo-auto-update: true
geo-update-interval: 24

external-controller-cors:
  allow-private-network: true

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

sniffer:
  enable: true
  override-destination: false
  sniff:
    QUIC:
      ports: [443]
    TLS:
      ports: [443]
    HTTP:
      ports: [80]

# ================= ������ DNS ���� =================
dns:
  enable: true
  prefer-h3: false
  listen: 0.0.0.0:1053
  ipv6: false
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - '*.lan'
    - '*.local'
    - 'dns.google'
    - "localhost.ptlogin2.qq.com"
    - "*.378555.xyz"
  use-hosts: true
  default-nameserver:
    - 223.5.5.5
    - 114.114.114.114
    - 8.8.8.8
  nameserver:
    - https://1.1.1.1/dns-query
    - https://8.8.8.8/dns-query
    - 1.1.1.1
    - 8.8.8.8
  proxy-server-nameserver:
    - https://223.5.5.5/dns-query
    - https://1.12.12.12/dns-query
  nameserver-policy:
    "geosite:cn,private":
      - https://doh.pub/dns-query
      - https://dns.alidns.com/dns-query

proxies: []

# ================= 1. ��̬������Դ =================
proxy-providers:
  free_pool_provider:
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/Pawdroid/Free-servers/main/sub"
    interval: 3600
    path: ./proxies/free_pool.yaml
    health-check:
      enable: true
      url: http://www.gstatic.com/generate_204
      interval: 300

  ikuuu_provider:
    type: http
    url: "https://b7k1r.no-mad-world.club/link/gEwRIYIFIPwYWwUi?clash=3&extend=1"
    interval: 3600
    path: ./proxies/ikuuu.yaml
    health-check:
      enable: true
      url: http://www.gstatic.com/generate_204
      interval: 300

  virmach_provider:
    type: http
    url: "https://vm.378555.xyz/virmach.yaml"
    interval: 86400
    path: ./proxies/virmach.yaml
    health-check:
      enable: true
      url: http://www.gstatic.com/generate_204
      interval: 300

# ================= 2. �߿������Զ�������� =================
proxy-groups:
  - name: ?? ��ѽڵ��
    type: url-test
    use:
      - free_pool_provider
    url: "http://www.gstatic.com/generate_204"
    interval: 60     # ?? ������̭
    tolerance: 100
    timeout: 3000    # ?? 3��������ֱ�ӱе�

  - name: ?? ikuuu-����
    type: url-test
    use:
      - ikuuu_provider
    url: "http://www.gstatic.com/generate_204"
    interval: 60
    tolerance: 100
    timeout: 3000

  - name: ???? Virmach-����
    type: url-test
    use:
      - virmach_provider
    url: "http://www.gstatic.com/generate_204"
    interval: 60
    tolerance: 50
    timeout: 3000

  - name: ?? �߿����Զ��л�
    type: fallback
    proxies:
      - ?? ��ѽڵ��
      - ?? ikuuu-����
      - ???? Virmach-����
    url: "http://www.gstatic.com/generate_204"
    interval: 30     # ?? 30���޸��л�����ס�������񲻶���
    timeout: 3000

  - name: �ֶ��л�
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - ???? Virmach-����
      - ?? ikuuu-����
      - ?? ��ѽڵ��
      - DIRECT

  - name: ȫ�����
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - �ֶ��л�
      - ???? Virmach-����

  - name: ��ý��
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - �ֶ��л�
      - DIRECT

  - name: OpenAI
    type: select
    proxies:
      - ???? Virmach-����
      - �ֶ��л�
      
  - name: ClaudeAI
    type: select
    proxies:
      - ???? Virmach-����
      - �ֶ��л�
      
  - name: Google
    type: select
    proxies:
      - ???? Virmach-����
      - �ֶ��л�
      - DIRECT
      
  - name: GitHub
    type: select
    proxies:
      - ???? Virmach-����
      - �ֶ��л�
      - DIRECT

  - name: Telegram
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - �ֶ��л�

  - name: YouTube
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - �ֶ��л�

  - name: Netflix
    type: select
    proxies:
      - ��ý��
      - �ֶ��л�

  - name: Spotify
    type: select
    proxies:
      - ��ý��
      - �ֶ��л�
      - DIRECT

  - name: HBO
    type: select
    proxies:
      - ��ý��
      - �ֶ��л�

  - name: Bing
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - �ֶ��л�

  - name: Disney
    type: select
    proxies:
      - ��ý��
      - �ֶ��л�

  - name: ����ý��
    type: select
    proxies:
      - DIRECT

  - name: ����ֱ��
    type: select
    proxies:
      - DIRECT

  - name: ©��֮��
    type: select
    proxies:
      - ?? �߿����Զ��л�
      - ???? Virmach-����
      - DIRECT

# ================= 3. �ⲿ����� =================
rule-providers:
  lan:
    type: http
    behavior: classical
    interval: 86400
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Lan/Lan.yaml
    path: ./ruleset/lan.yaml
  reject:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt
    path: ./ruleset/reject.yaml
    interval: 86400
  proxy:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt
    path: ./ruleset/proxy.yaml
    interval: 86400
  direct:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/direct.txt
    path: ./ruleset/direct.yaml
    interval: 86400
  private:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt
    path: ./ruleset/private.yaml
    interval: 86400
  gfw:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt
    path: ./ruleset/gfw.yaml
    interval: 86400
  greatfire:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/greatfire.txt
    path: ./ruleset/greatfire.yaml
    interval: 86400
  tld-not-cn:
    type: http
    behavior: domain
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt
    path: ./ruleset/tld-not-cn.yaml
    interval: 86400
  telegramcidr:
    type: http
    behavior: ipcidr
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt
    path: ./ruleset/telegramcidr.yaml
    interval: 86400
  applications:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt
    path: ./ruleset/applications.yaml
    interval: 86400
  Disney:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Disney/Disney.yaml
    path: ./ruleset/disney.yaml
    interval: 86400
  Netflix:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Netflix/Netflix.yaml
    path: ./ruleset/netflix.yaml
    interval: 86400
  YouTube:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/YouTube/YouTube.yaml
    path: ./ruleset/youtube.yaml
    interval: 86400
  HBO:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/HBO/HBO.yaml
    path: ./ruleset/hbo.yaml
    interval: 86400
  OpenAI:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/OpenAI/OpenAI.yaml
    path: ./ruleset/openai.yaml
    interval: 86400
  ClaudeAI:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Claude/Claude.yaml
    path: ./ruleset/claudeai.yaml
    interval: 86400
  Bing:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Bing/Bing.yaml
    path: ./ruleset/bing.yaml
    interval: 86400
  Google:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Google/Google.yaml
    path: ./ruleset/google.yaml
    interval: 86400
  GitHub:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/GitHub/GitHub.yaml
    path: ./ruleset/github.yaml
    interval: 86400
  Spotify:
    type: http
    behavior: classical
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Spotify/Spotify.yaml
    path: ./ruleset/spotify.yaml
    interval: 86400
  ChinaMaxDomain:
    type: http
    behavior: domain
    interval: 86400
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_Domain.yaml
    path: ./ruleset/chinamaxdomain.yaml
  ChinaMaxIPNoIPv6:
    type: http
    behavior: ipcidr
    interval: 86400
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_IP_No_IPv6.yaml
    path: ./ruleset/chinamaxipnoipv6.yaml

# ================= 4. ��������ƥ�� =================
rules:
  # �ײ�����ֱ����������������������
  - IP-CIDR,127.0.0.0/8,DIRECT,no-resolve
  - IP-CIDR,192.168.0.0/16,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,100.64.0.0/10,DIRECT,no-resolve
  
  # BT/PT Э���й©
  - DST-PORT,6881-6889,DIRECT
  - DOMAIN-KEYWORD,tracker,DIRECT
  - DOMAIN-KEYWORD,torrent,DIRECT
  
  # ����Ӧ�þ�׼����
  - RULE-SET,YouTube,YouTube
  - RULE-SET,Google,Google
  - RULE-SET,GitHub,GitHub
  - RULE-SET,telegramcidr,Telegram,no-resolve
  - RULE-SET,Spotify,Spotify
  - RULE-SET,Netflix,Netflix
  - RULE-SET,HBO,HBO
  - RULE-SET,Bing,Bing
  - RULE-SET,OpenAI,OpenAI
  - RULE-SET,ClaudeAI,ClaudeAI
  - RULE-SET,Disney,Disney
  
  # ��̬�����ƥ��
  - RULE-SET,proxy,ȫ�����
  - RULE-SET,gfw,ȫ�����
  - RULE-SET,applications,����ֱ��
  - RULE-SET,ChinaMaxDomain,����ֱ��
  - RULE-SET,ChinaMaxIPNoIPv6,����ֱ��,no-resolve
  - RULE-SET,lan,����ֱ��,no-resolve
  
  # ����λ���붵��
  - GEOIP,CN,����ֱ��
  - MATCH,©��֮��
