mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4840] [Bug]: 入站协议从vless+TCP+Reality修改为vless+XHTTP+Reality后,节点无法使用,出现-1 #3372
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3372
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gl1102 on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4840
Describe the bug
入站协议从vless+TCP+Reality修改为vless+XHTTP+Reality后,节点无法使用,出现-1
After switching the inbound protocol from VLESS+TCP+Reality to VLESS+XHTTP+Reality, the node fails to work and returns error code -1.
可能原因是因为我在RAW作为传输方式时设置了流控xtls-rprx-vision,而xhttp没有这个选项,所以在原有节点进行修改传输方式时,就会导致节点失效
The root cause is presumed as follows: flow control
xtls-rprx-visionwas configured under the original RAW transport setting, yet this parameter is unsupported for XHTTP transport. Directly modifying the transport mode on the existing node without removing the invalid option consequently renders the node unusable.How to reproduce the problem
新建一个vless+TCP+Reality入站,并设置好用户流控,然后修改入站为vless+XHTTP+Reality后,用户重新订阅后节点失效
Create a new VLESS+TCP+Reality inbound and configure the user's flow control parameters accordingly. After switching the inbound transport to VLESS+XHTTP+Reality and having users resubscribe, the node becomes unavailable.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.6
Xray-core version
No response
How did you install 3x-ui?
Docker / Docker Compose
Operating system
Ubuntu24.02
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 3, 2026):
感谢详细的问题描述,根因分析完全正确。已通过代码确认这是一个真实的 bug。
根因(已在代码中确认)
两处关键代码存在缺陷:
1. Xray 运行时配置生成 (
web/service/xray.go:149-161)在为 VLESS 协议生成客户端条目时,只要
flow字段非空就直接写入配置,不检查当前传输方式是否支持流控:2. 修改入站时未清理 flow (
web/service/inbound.go)UpdateInbound()调用了normalizeStreamSettings()处理传输协议的设置,但不会在传输方式从 TCP 改为 XHTTP 时自动清除客户端的flow字段。实际上代码中存在
inboundCanEnableTlsFlow()函数(inbound.go:284),它能正确判断仅TCP + TLS/Reality时才允许 flow,但该函数只在"复制客户端到新入站"时被调用,UpdateInbound()中没有调用它。结果:修改传输后,客户端数据库记录中的
flow: xtls-rprx-vision依然存在,被写入 Xray 运行时配置,而 XHTTP 不支持该参数,导致连接失败(返回 -1)。值得注意的是,订阅链接生成(
sub/subService.go:424-431)是正确的——它已经做了streamNetwork == "tcp"的判断,所以分享链接本身不会携带flow。问题出在 Xray-core 的运行时配置侧。临时解决方案
在修改传输方式为 XHTTP 后,手动清空每个客户端的 Flow 字段:
正确修复方向
应在以下至少一处添加传输方式兼容性检查:
web/service/xray.go:159:在写入entry["flow"]前,调用类似inboundCanEnableTlsFlow()的判断,若传输方式不支持流控则跳过。web/service/inbound.go(UpdateInbound()):当检测到传输方式由 TCP 改为其他(XHTTP/WS/gRPC 等)时,自动将关联客户端的flow字段清空。欢迎提交 PR 修复此问题。
@MHSanaei commented on GitHub (Jun 3, 2026):
i don't understand anything of this
open issue only english please