LeadaxeLxBox / sing-box-lx 开发者
GitHub·2026.09.18 08:49:57(UTC+8)

Leadaxe:Xray 与 sing-box 在 gRPC serviceName 路径上的差异

Leadaxe 复现并说明:Xray 中以 / 开头的 serviceName 是服务/流名记法;sing-box 总会追加 /Tun 可能导致 404。singbox-launcher 导入时已做转换,但多段斜杠仍受内核 URL 编码限制。

作者原文@Leadaxe

Thanks for the report — reproduced, and the cause is on our side.

In Xray, a serviceName that starts with / is a different notation, not just a slash-prefixed name: the last segment is the gRPC stream name, so /xxxxx/something/Tun means service xxxxx/something + stream Tun, and the request path on the wire is /xxxxx/something/Tun. sing-box takes the plain service name and always appends /Tun, so we were sending the whole string as the service name and the server saw a different path — hence the 404.

The launcher (develop) now translates that form on import, so /<service>/Tun gives the same request path Xray would produce. One caveat: the core percent-encodes / inside service_name, so a name with several segments (like yours) still cannot be expressed exactly — we have filed that with the sing-box-lx core. If you can, a single-segment serviceName (/xxxxx/Tun) will work in the meantime. Leaving this open until the core side lands.