refactor(agent): route 块改由 buildRoute 统一产出,合并 ACL 与 WARP

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-23 01:52:39 +08:00
parent 597d6ab68b
commit 4155fc8542
4 changed files with 122 additions and 17 deletions
-12
View File
@@ -100,15 +100,3 @@ func (wc *WarpConfig) warpEndpoint() map[string]any {
"peers": []any{peer},
}
}
// warpRoute 构造分流 route:先 sniff 取出 SNI/Host(客户端多半发的是已解析 IP,
// 不 sniff 域名规则无从命中),命中域名后缀走 warp,其余 final=direct。
func (wc *WarpConfig) warpRoute() map[string]any {
return map[string]any{
"rules": []any{
map[string]any{"action": "sniff"},
map[string]any{"domain_suffix": wc.cleanDomains(), "outbound": warpOutboundTag},
},
"final": directOutboundTag,
}
}