Files
chuan 2aacef3b3f
Docker Build / docker-build (push) Successful in 24s
feat: 增加启动自动恢复的功能
2026-05-27 11:40:23 +08:00

2.6 KiB
Raw Permalink Blame History

路由配置

对应 settings.toml[routing]

自定义规则详细语法见 路由自定义规则

设置 UI 默认值 可选值 作用 什么时候修改
mode 显示 whitelist UIwhitelist / gfwlist / proxy / direct / block;模型另支持 custom / routingA 控制 rule 入站和部分透明代理流量的分流模式。 改变整体分流策略时修改。
default_rule 隐藏 proxy direct / proxy / block custom / routingA 等模式的兜底出口。UI 保存时固定为 proxy 需要兜底直连或阻断时手改。
routing_a 显示 "" RoutingA 风格文本 解析 domain(...) -> outboundip(...) -> outbound 规则,优先于内置模式规则。 少量自定义前置规则时使用。
custom_rules 隐藏 [] [[routing.custom_rules]] mode = custom 时生成规则。 需要结构化 custom TOML 规则时手改。

路由模式

模式 行为 适用场景
whitelist Apple push 直连;geolocation-!cn、Google、港澳 IP 代理;geosite:cn、私有/中国 IP 直连;兜底按 default_rule 国内直连、国外代理。
gfwlist geolocation-!cn 和 Telegram IP 代理;其它直连。 只代理规则命中的目标。
proxy 全部走 proxy 简单全局代理。
direct 全部走 direct 临时关闭代理但保留服务。
block 全部走 block 测试或阻断入口流量。
custom 使用 custom_rules,最后走 default_rule 结构化规则。
routingA 使用 routing_a,最后走 default_rule 兼容 RoutingA 风格配置。

routing_a 语法

语法 示例 说明
domain(...) -> outbound domain(geosite:google)->proxy 写入 Xray rule 的 domain
ip(...) -> outbound ip(geoip:cn)->direct 写入 Xray rule 的 ip
注释 # comment 空行和 # 开头行忽略。

outbound 可用 proxydirectblock,也可以是自定义 outbound tag。

custom_rules

设置 UI 默认值 可选值 作用
filename 隐藏 "" 字符串 非空时生成 ext:<filename>:<tag>
tags 隐藏 [] 字符串数组 geosite/geoip/tag 列表。
match_type 隐藏 domain domain / ip 决定写入 Xray rule 的 domain 还是 ip
rule_type 隐藏 proxy direct / proxy / block 命中后的出口。