mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5065] [Feature]: Fallback for vless+xhttp #3565
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#3565
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 @Jabca on GitHub (Jun 7, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5065
Is your feature request related to a problem?
No way to define fallback for vless+xhttp inbound, like redirect or defined payload
Describe the solution you'd like
Page in ui to add fallbacks for the inbound
Alternatives you've considered
Concrete use case
I want my domain to look legit, by adding some mockup of a web page for port 443
Mockups, screenshots, or examples
Which parts of the panel would this affect?
Frontend (UI / panel pages)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 7, 2026):
Thanks for the detailed request, @Jabca.
Current state
3x-ui already has a full Fallbacks UI (the
FallbacksCardcomponent with add/remove/reorder rows, SNI/ALPN/Path/Dest/Xver fields) and a complete backend service (web/service/fallback.go). However, the fallback feature is gated to TCP transport only, enforced in two places:frontend/src/pages/inbounds/form/InboundFormModal.tsx:179–182):web/service/inbound.go:443–451):inboundCanHostFallbacks()applies the same TCP + TLS/Reality check before injectingsettings.fallbacksinto the Xray config.Why XHTTP is excluded
Xray-core's
fallbacksarray (in VLESS/Trojan inbound settings) is a raw-TCP intercept: after a TLS handshake, Xray peeks at the first bytes; if they don't match the proxy protocol, it forwards the raw byte stream to another port/process. This works because Xray still has the bare TCP connection at that point.With XHTTP transport, the stream is already parsed as HTTP by the time Xray hands it to the proxy layer. There is no bare TCP stream left to forward, so the
fallbacksmechanism simply does not apply. The XHTTP settings schema (frontend/src/schemas/protocols/stream/xhttp.ts) has nofallbackorredirectfield, and Xray-core does not expose one for this transport.What this feature would require
For the UI goal to be achievable end-to-end, Xray-core would first need to expose a per-path "unmatched-request" redirect/response mechanism for XHTTP inbounds. Once that exists upstream, 3x-ui could surface it in the XHTTP transport form (not through the existing
FallbacksCard, which is TCP-specific).Workaround in the meantime
The cleanest way to make port 443 serve a real webpage for non-proxy visitors while VLESS+XHTTP runs behind it is to put a reverse proxy (e.g. Nginx or Caddy) in front:
/your-path),proxy_passto Xray's XHTTP inbound (listening on a local port without TLS).This keeps the "legit domain" appearance and is not overwritten by panel saves. The panel's Advanced tab and raw-config editing remain workarounds but will indeed be overwritten — the panel is the authoritative config source, which is by design.
If Xray-core adds native XHTTP fallback/redirect support in a future release, please reopen or link that upstream issue here so 3x-ui can track it.