mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6313] [Bug] VLESS TCP Reality fallback to XHTTP does not work #4285
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#4285
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 @SatenRuiko-Lv0 on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6313
Describe the bug
When configuring a VLESS TCP + Reality inbound on port 443 with fallback to another VLESS XHTTP inbound, the fallback connection cannot be established.
The 443 VLESS Reality connection works normally, but when using the fallback XHTTP configuration, the client cannot connect.
The same XHTTP inbound works when exposed on its own port, but fails when used as a fallback target.
Environment
3x-ui version: v3.7.0
Xray-core version: latest version
OS: Debian 13
Protocol:
VLESS TCP + Reality (port 443)
fallback → VLESS XHTTP
Expected behavior
Expected configuration:
:443
|
|-- VLESS + TCP + Reality
|
fallback
|
127.0.0.1:11581
|
VLESS + XHTTP
The XHTTP inbound should be reachable through the Reality inbound fallback.
Actual behavior
VLESS TCP + Reality on port 443 works normally.
Direct connection to XHTTP inbound port works normally.
But Reality fallback to XHTTP does not work.
Client cannot establish the XHTTP connection through port 443.
Steps to reproduce
port: 443
network: tcp
security: reality
flow: xtls-rprx-vision-udp443
port: 11581
network: xhttp
security: none
path: /dingtalk
mode: stream-one
443 Reality inbound
|
fallback
|
127.0.0.1:11581
Result:
connection failed
How to reproduce the problem
(;へ:)
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.7.0
Xray-core version
26.7.28
How did you install 3x-ui?
install.sh script
Operating system
Debian13
Which parts of the panel are affected?
No response
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 (Aug 25, 2026):
Thanks for the report. I can't confirm a panel defect from what's here — everything 3x-ui actually contributes to this setup (the
settings.fallbacksblock it writes into the Xray config) is generated in the shape Xray expects, and it's covered by a regression test. Whether the fallback then works is decided by xray-core's dispatch and by the client config, and the report has no logs and no generated config, so I can't tell which of those failed. Two concrete things in your description are the likely culprits, and the first one you can check right now.What the panel emits for your setup
Your master qualifies for fallbacks — VLESS + raw TCP + REALITY is exactly the gate:
The rule row is then turned into a plain Xray fallback entry (
internal/web/service/fallback.go:125-152), with the loopbackdestfilled in for you because your child listens on the wildcard:and injected into the master's settings at
internal/web/service/xray.go:269-282. So the panel should be writing{"dest": "127.0.0.1:11581", "path": "/dingtalk"}into the 443 inbound. That's the standard Xray fallback shape; 3x-ui does not implement the fallback dispatch itself.Likely cause 1 — the child's share link is not rewritten while it listens on
0.0.0.0You wrote that "the same XHTTP inbound works when exposed on its own port", which means its Listen field is blank or
0.0.0.0. In that state the panel deliberately does not project the child's share link/QR through the master:That guard was added on purpose (see the comment at
internal/sub/service.go:537-542, referencing #4987) so a publicly reachable inbound doesn't leak the master's port and REALITY keys. The practical consequence for you: the link the panel gives you for the XHTTP inbound still says port11581,security: none— it will never traverse 443. Set the XHTTP inbound's Listen to127.0.0.1, save, and re-copy its link; it should then come out on the master's:443with the master's REALITY parameters merged in (internal/sub/service.go:586-616).Likely cause 2 — ALPN / HTTP-2 (inference, not verified)
When you pick the child from the Fallbacks dropdown, the panel auto-fills Path from the child's
xhttpSettings.pathbut leaves ALPN empty, because it reads ALPN off the child's TLS block and your child hassecurity: none:An empty
alpnmeans "match any", which is permissive and fine. The part I could not verify here is what happens one layer down: an XHTTP client over a REALITY connection may negotiate ALPNh2, and if xray-core's fallback path matcher only reads an HTTP/1.1 request line,/dingtalkin a binary HTTP/2 HEADERS frame would never match and the connection would be dropped instead of forwarded. I have no access to the xray-core sources from here, so I am flagging that as an inference, not a fact. If it turns out to be the cause, the ALPN box in the Fallbacks card lets you seth2by hand — the panel passes it straight through (internal/web/service/fallback.go:143-145).What would settle this
The Relevant logs section came through empty, so please add:
journalctl -u x-ui -e --no-pager -f -p debug(this is what thex-uimenu's log option runs). This is the single most useful item: it shows whether Xray rejected the fallback config, dropped the connection at the matcher, or never saw the request at all.settingsblock of the 443 inbound (from the panel's Xray config view), redacted — so we can see the exactfallbacksarray the panel produced.0.0.0.0/127.0.0.1).path,mode, and which inbound's UUID it carries (the child's, not the master's).Please paste these as text rather than screenshots; I can't read images.
Verdict: Insufficient information
Severity: N/A
Confidence: Medium
Root cause: None established. The panel-side path is correct end to end:
inboundCanHostFallbacks(internal/web/service/inbound_protocol.go:109-137) admits VLESS+tcp+reality,FallbackService.BuildFallbacksJSON(internal/web/service/fallback.go:95-155) emits{dest, name?, alpn?, path?, xver?}, andinternal/web/service/xray.go:269-282injects it into the master's settings. The failure is in the runtime data plane, which 3x-ui does not implement. Most likely non-defect explanation: the child inbound still listens on the wildcard, soprojectThroughFallbackMaster(internal/sub/service.go:543-549) declines to rewrite its share link and the client config still targets:11581withsecurity: none.Already fixed: Not applicable — v3.7.0 is the current release (
gh release list: v3.7.0, 2026-08-24), and nothing has landed on the default branch since for this path.Duplicate of: None. Related: #5065 (closed, NOT_PLANNED) covers the opposite direction — XHTTP as the fallback host — not XHTTP as a fallback target.
Evidence:
internal/web/service/inbound_protocol.go:133-136(if stream.Network != "tcp" { return false }/return stream.Security == "tls" || stream.Security == "reality");internal/web/service/fallback.go:131-135(loopbackdestdefault) and:137-151(entry keys);internal/web/service/xray.go:269-282(settings["fallbacks"] = generic);internal/sub/service.go:547-549+:242-250(listenIsInternalOnlygate, comment at:537-542cites #4987);frontend/src/pages/inbounds/form/useInboundFallbacks.ts:87-89(ALPN derived from the child'stlsSettings) and:100-103(path derived fromxhttpSettings.path);TestBuildRuntimeInboundForAPI_InjectsFallbacks(internal/web/service/inbound_fallback_runtime_test.go:15) pins that the fallback rows reach the runtime inbound settings.Not determined: Whether xray-core matches a fallback
pathagainst an HTTP/2 first packet, and what ALPN a REALITY inbound ends up negotiating for an XHTTP client. I could not read the xray-core sources in this environment. Item 1 above (the Xray debug log) settles it.This reply was generated automatically; a maintainer may follow up.
@ManguoLabsTech commented on GitHub (Aug 25, 2026):
初步评估,此现象通常属于 Xray-core 对特定传输协议(XHTTP)的回落分发特性或客户端 ALPN/Header 匹配问题,而非 3x-ui 面板写入配置文件的配置缺失。3x-ui 仅负责将设置渲染至 Xray 的
fallbacks结构中,实际的分发行为由 Xray 内核处理。故障排查步骤
fallbacks块结构:验证是否包含正确的
dest(如127.0.0.1:11581)以及path(如/dingtalk)。在客户端尝试连接时,重点观察日志中是否有
fallback matched或fallback ended相关的记录。如果日志未触发 path 匹配,说明客户端发送的首包未能满足回落识别条件。当 XHTTP 经过 Reality 回落时,客户端必须通过 TCP/TLS 正确发送包含对应 Path 的请求。
如果后端的 XHTTP 使用了特殊 stream 模式,请确保回落规则中的
alpn参数与客户端一致。如需进一步协助分析,请提供经过脱敏处理的
/etc/xray/config.jsoninbound 部分配置以及 Xray 的 debug 日志片段。@SatenRuiko-Lv0 commented on GitHub (Aug 25, 2026):
After enabling the fallback, I ran 14 restart on the VPS, and the fallback XHTTP started working successfully.
It's a bit strange that it didn't work immediately after applying the configuration, but restarting the service fixed it.
The issue is resolved for now. Thanks for your help.🐧🌹