port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: info
external-controller: 9090

proxies:
  - name: "🇺🇸US"
    type: http
    server: proxy.diremo.top
    port: 443
    username: US
    password: qHQ+x9QWz_jJCF
    tls: true
  - { name: PreNode1, type: vmess, server: planb.mojcn.com, port: 16617, uuid: e8a7a02b-781f-4030-876d-274f8c1a4be5, alterId: 0, cipher: auto, udp: true, network: ws, ws-opts: { path: /, headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }, ws-path: /, ws-headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }
  - { name: PreNode2, type: vmess, server: m.cnmjin.net, port: 16617, uuid: e8a7a02b-781f-4030-876d-274f8c1a4be5, alterId: 0, cipher: auto, udp: true, network: ws, ws-opts: { path: /, headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }, ws-path: /, ws-headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }
  - { name: PreNode3, type: vmess, server: t.cnmjcn.cyou, port: 16617, uuid: e8a7a02b-781f-4030-876d-274f8c1a4be5, alterId: 0, cipher: auto, udp: true, network: ws, ws-opts: { path: /, headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }, ws-path: /, ws-headers: { Host: 6c473ddb7ab6eecf2e043a676ae7ea3b.mobgslb.tbcache.com } }


proxy-groups:
  - name: "Proxies"
    type: select
    proxies:
      - ⚡Auto
  - name: "⚡Auto"
    type: relay
    proxies:
      - AutoPreNode
      - 🇺🇸US

  - name: "AutoPreNode"
    type: url-test
    proxies:
      - PreNode1
      - PreNode2
      - PreNode3
    url: "https://www.gstatic.com/generate_204"
    interval: 1800  # s
    tolerance: 100 # ms


rule-providers:
  private:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
    path: ./ruleset/private.yaml
    interval: 86400

  direct:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
    path: ./ruleset/direct.yaml
    interval: 86400

  lancidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
    path: ./ruleset/lancidr.yaml
    interval: 86400
  
  cncidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
    path: ./ruleset/cncidr.yaml
    interval: 86400

  apple:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
    path: ./ruleset/apple.yaml
    interval: 86400

  applications:
    type: http
    behavior: classical
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
    path: ./ruleset/applications.yaml
    interval: 86400

  proxy:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
    path: ./ruleset/proxy.yaml
    interval: 86400

  gfw:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
    path: ./ruleset/gfw.yaml
    interval: 86400

  telegramcidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
    path: ./ruleset/telegramcidr.yaml
    interval: 86400

  reject:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
    path: ./ruleset/reject.yaml
    interval: 86400

rules:
  - DOMAIN,clash.razord.top,DIRECT
  - DOMAIN,yacd.haishan.me,DIRECT
  - RULE-SET,applications,DIRECT
  - RULE-SET,private,DIRECT
  - RULE-SET,direct,DIRECT
  - RULE-SET,lancidr,DIRECT
  - RULE-SET,cncidr,DIRECT
  - RULE-SET,apple,DIRECT
  - RULE-SET,applications,DIRECT
  - RULE-SET,proxy,Proxies
  - RULE-SET,gfw,Proxies
  - RULE-SET,telegramcidr,Proxies
  - RULE-SET,reject,REJECT
  - GEOIP,LAN,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,Proxies