Leadaxe:说明 Xray 与 sing-box 在 gRPC serviceName 路径解析上的差异与转换逻辑

Leadaxe 说明 Xray 与 sing-box 在 gRPC serviceName 路径解析上的区别:Xray 允许斜杠前缀表示服务与流名,而 sing-box 始终在服务名后追加 /Tun 导致 404;singbox-launcher 在导入时已做转换,但多段斜杠仍受内核 URL 编码限制。

作者原文

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.