Clash Field
Clash Field
Section titled “Clash Field”Default
Section titled “Default”proxies
Section titled “proxies”代理节点,内容为数组。来源于配置文件。
proxy-groups
Section titled “proxy-groups”由多个代理节点组成。来源于配置文件。
proxy-providers
Section titled “proxy-providers”代理提供器,能够合并多个配置文件。
代理规则,规则按从上到下的顺序匹配,列表上方的规则优先级高于下方的规则。
rule-providers
Section titled “rule-providers”代理规则提供器,能够单独管理规则并单独更新。
Handle
Section titled “Handle”运行模式。
rule基于规则的匹配global全局代理(需要在 GLOBAL 代理组中选择代理/策略)direct全局直连
HTTP(S) 代理端口。
socks-port
Section titled “socks-port”SOCKS4/4a/5 代理端口。
mixed-port
Section titled “mixed-port”混合端口是一种特殊端口,同时支持 HTTP(S) 和 SOCKS5 协议。你可以使用任何支持 HTTP 或 SOCKS 代理的程序连接此端口。
allow-lan
Section titled “allow-lan”允许其他设备通过 Clash 代理端口访问互联网。
log-level
Section titled “log-level”控制 Clash 内核的日志级别,仅输出到控制台和控制页面。
silent静默,无输出。error输出错误和不可用的日志。warning输出不影响操作的错误日志和错误级别日志。info输出一般操作日志,以及错误和警告级别日志。debug在运行时输出尽可能多的信息。
是否允许内核接受 IPv6 流量。
secret
Section titled “secret”外部控制 API 的访问密钥。
external-controller
Section titled “external-controller”外部控制器,允许使用 RESTful API 控制 Clash 内核。
API 监听地址,可以将 127.0.0.1 改为 0.0.0.0 以监听所有 IP。
启用 DNS 配置字段。
启用 TUN 配置字段。
eBPF 重定向到 TUN 是一种拦截特定网络接口上的所有网络流量并将其重定向到 TUN 接口的功能。此功能需要内核支持。
支持的内核:Mihomo Clash Premium
启用 hosts 配置字段。
script
Section titled “script”Clash Premium 实现了基于 Python3 的脚本功能,允许用户动态灵活地为数据包选择策略。
profile
Section titled “profile”在官方 Clash 文档中,profile 应作为扩展配置,但在 Clash.meta 中,它仅用作缓存项。
payload
Section titled “payload”Payload 作为 rule-providers 的内容。
tunnels
Section titled “tunnels”流量转发隧道,能够转发 TCP/UDP 流量,也可以通过代理转发。
auto-redir
Section titled “auto-redir”experimental
Section titled “experimental”实验性配置
interface-name
Section titled “interface-name”为 proxy-groups 指定出站网络接口。
routing-mark
Section titled “routing-mark”为 proxy-groups 出站时附加路由标记。
redir-port
Section titled “redir-port”重定向端口仅适用于 Linux(Android)和 macOS。 只能代理 TCP 流量。
tproxy-port
Section titled “tproxy-port”透明代理端口仅适用于 Linux(Android)。 能够代理 TCP 和 UDP 流量。
iptables
Section titled “iptables”external-ui
Section titled “external-ui”允许在 Clash API 上运行静态网页资源(如 Clash-dashboard),路径为 API 地址/ui。
bind-address
Section titled “bind-address”绑定地址,仅允许其他设备通过此地址访问。
authentication
Section titled “authentication”http(s)、socks 和 mixed 代理的用户认证。
代理字段。
sniffer
Section titled “sniffer”Clash 使用 Mapping 机制解决在透明代理场景下无法通过 Redir 端口传递域名的问题。然而,如果未使用 Clash 内置的 DNS 解析服务,此机制可能导致域名还原和基于域名的路由不准确。
Meta 整合了 Sniffer 域名嗅探器,通过读取握手数据包中的域名字段还原 IP,有效解决了 Mapping 机制的不足。
geox-url
Section titled “geox-url”自定义 GEO 下载地址
listeners
Section titled “listeners”sub-rules
Section titled “sub-rules”geodata-mode
Section titled “geodata-mode”更改 geoip 使用文件,mmdb 或 dat,true 为 dat,默认值为 false。
unified-delay
Section titled “unified-delay”更改延迟计算方法,移除握手等额外延迟。
tcp-concurrent
Section titled “tcp-concurrent”enable-process
Section titled “enable-process”Meta 重命名 find-process-mode。
find-process-mode
Section titled “find-process-mode”控制 Clash 是否匹配进程。
always启用,强制匹配所有进程。strict默认,Clash 判断是否启用。off不匹配进程,推荐在路由器上使用。
skip-auth-prefixes
Section titled “skip-auth-prefixes”设置允许跳过认证的 IP 范围。
external-controller-tls
Section titled “external-controller-tls”HTTPS-API 监听地址,需要配置 tls 部分以设置证书和私钥,external-controller 也必须填写。
global-client-fingerprint
Section titled “global-client-fingerprint”全局 TLS 指纹,优先级低于 proxy 内的 client-fingerprint。 目前支持 TCP/grpc/WS/HTTP 传输的 TLS,支持 VLESS、Vmess 和 trojan 协议。