技术文档

Clash 完整配置参考

配置文件结构

# 基础配置
port: 7890              # HTTP 代理端口
socks-port: 7891       # SOCKS5 代理端口
mode: rule             # rule / rule / global
log-level: info

代理节点配置

proxies:
  - name: "ss-example"
    type: ss
    server: server
    port: 443
    cipher: aes-256-gcm
    password: "password"

规则配置

类型参数说明
DOMAINexample.com精确域名匹配
DOMAIN-SUFFIXgoogle.com域名后缀匹配
GEOIPCNIP 地理位置匹配
IP-CIDR192.168.0.0/16IP 段匹配

RESTful API

方法路径说明
GET/proxies获取所有代理
PUT/proxies/:name切换代理
GET/traffic获取流量