[GH-ISSUE #5439] [Question]: Does fallback mechanism should only work with VLESS TCP inbound or with any VLESS transports? #3803

Closed
opened 2026-10-31 20:35:05 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @AdLf0208 on GitHub (Jun 19, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5439

What are you trying to do?

Dear, @MHSanaei. I was browsing original xtls xray core page and stumbled upon this generic template fallback config:
{
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"users": [
// ... ...
],
"decryption": "none",
"fallbacks": [
{
"dest": 8080 // По умолчанию перенаправлять на прокси-сервер, защищенный от сканирования
}
]
},
"streamSettings": {
// ... ...
}
}
]
}

I thought "... ..." meant that any transport (tcp,xhttp or any other) is supported if you stick with vless protocol. But in 3x-ui panel I only saw this being configurable with VLESS TCP + (REALITY/TLS) configuration. Is it intentional? Thank you in advance for answering!

What have you already tried?

No response

3x-ui version

3.3.1

How did you install 3x-ui?

Docker / Docker Compose

Operating system

Debian 13

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @AdLf0208 on GitHub (Jun 19, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5439 ### What are you trying to do? Dear, @MHSanaei. I was browsing original xtls xray core page and stumbled upon this generic template fallback config: { "inbounds": [ { "port": 443, "protocol": "vless", "settings": { "users": [ // ... ... ], "decryption": "none", "fallbacks": [ { "dest": 8080 // По умолчанию перенаправлять на прокси-сервер, защищенный от сканирования } ] }, "streamSettings": { // ... ... } } ] } I thought "... ..." meant that any transport (tcp,xhttp or any other) is supported if you stick with vless protocol. But in 3x-ui panel I only saw this being configurable with VLESS TCP + (REALITY/TLS) configuration. Is it intentional? Thank you in advance for answering! ### What have you already tried? _No response_ ### 3x-ui version 3.3.1 ### How did you install 3x-ui? Docker / Docker Compose ### Operating system Debian 13 ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:35:05 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 19, 2026):

Yes, this is intentional. The fallback UI in 3x-ui is shown only when the inbound meets all three conditions: protocol is VLESS or Trojan, transport (network) is `tcp` (RAW), and security is `tls` or `reality`. This is enforced in two places in the source:

  • Frontend — frontend/src/pages/inbounds/form/InboundFormModal.tsx lines 233–236:

    const isFallbackHost =
      (protocol === Protocols.VLESS || protocol === Protocols.TROJAN)
      && network === 'tcp'
      && (security === 'tls' || security === 'reality');
    

    The FallbacksCard is rendered only when isFallbackHost is true; an informational alert is shown instead when the protocol is right but TLS/Reality is not enabled.

  • Backend — internal/web/service/inbound_protocol.go, function inboundCanHostFallbacks (line 91), which calls streamSupportsFallbacks (line 104). That function returns false if stream.Network \!= "tcp" or if security is not tls/reality. The comment in the source reads: "Xray only honors fallbacks on VLESS and Trojan inbounds carried over TCP transport with TLS or Reality security. This is intentionally stricter than inboundCanEnableTlsFlow: fallbacks are a raw-TCP-only feature."

Why other transports are excluded

Xray-core's fallbacks array works by intercepting the raw TCP byte stream immediately after TLS termination. Xray peeks at the first bytes of the decrypted payload; if they do not match the expected proxy framing, it forwards the entire raw byte stream to the configured dest port. This works because Xray still holds a bare TCP connection at that point.

With WebSocket, gRPC, HTTPUpgrade, or XHTTP, the connection has already been parsed as an HTTP request by the time xray-core reaches the proxy layer. There is no bare TCP stream left to forward, so the fallbacks mechanism cannot operate. This is an upstream constraint of xray-core, not a 3x-ui limitation.

The "streamSettings": { // ... ... } in the template you found on the xray-core documentation page is a placeholder indicating that the field must be present — it is not claiming that every network value supports fallbacks.

Related issue

Feature request #5065 ("Fallback for vless+xhttp") covers exactly this gap. It was closed because the capability does not exist at the xray-core level. If xray-core adds a mechanism to redirect unmatched requests on XHTTP inbounds in the future, that issue is the right place to track it.

Workaround for a "legit-looking" domain on other transports

Place a reverse proxy (Nginx, Caddy, HAProxy) in front of your Xray instance on port 443. Let the reverse proxy handle TLS, serve your static site by default, and forward only the specific XHTTP/WebSocket path to Xray's inbound (listening on a local port without TLS). This is not overwritten by panel saves and is the standard approach for this use case.


This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4753458198 --> @github-actions[bot] commented on GitHub (Jun 19, 2026): Yes, this is intentional. The fallback UI in 3x-ui is shown only when the inbound meets all three conditions: protocol is VLESS or Trojan, transport (network) is \`tcp\` (RAW), and security is \`tls\` or \`reality\`. This is enforced in two places in the source: - **Frontend** — `frontend/src/pages/inbounds/form/InboundFormModal.tsx` lines 233–236: ```ts const isFallbackHost = (protocol === Protocols.VLESS || protocol === Protocols.TROJAN) && network === 'tcp' && (security === 'tls' || security === 'reality'); ``` The `FallbacksCard` is rendered only when `isFallbackHost` is true; an informational alert is shown instead when the protocol is right but TLS/Reality is not enabled. - **Backend** — `internal/web/service/inbound_protocol.go`, function `inboundCanHostFallbacks` (line 91), which calls `streamSupportsFallbacks` (line 104). That function returns false if `stream.Network \!= "tcp"` or if security is not `tls`/`reality`. The comment in the source reads: *"Xray only honors fallbacks on VLESS and Trojan inbounds carried over TCP transport with TLS or Reality security. This is intentionally stricter than inboundCanEnableTlsFlow: fallbacks are a raw-TCP-only feature."* **Why other transports are excluded** Xray-core's `fallbacks` array works by intercepting the raw TCP byte stream immediately after TLS termination. Xray peeks at the first bytes of the decrypted payload; if they do not match the expected proxy framing, it forwards the entire raw byte stream to the configured `dest` port. This works because Xray still holds a bare TCP connection at that point. With WebSocket, gRPC, HTTPUpgrade, or XHTTP, the connection has already been parsed as an HTTP request by the time xray-core reaches the proxy layer. There is no bare TCP stream left to forward, so the `fallbacks` mechanism cannot operate. This is an upstream constraint of xray-core, not a 3x-ui limitation. The `"streamSettings": { // ... ... }` in the template you found on the xray-core documentation page is a placeholder indicating that the field must be present — it is not claiming that every `network` value supports `fallbacks`. **Related issue** Feature request #5065 ("Fallback for vless+xhttp") covers exactly this gap. It was closed because the capability does not exist at the xray-core level. If xray-core adds a mechanism to redirect unmatched requests on XHTTP inbounds in the future, that issue is the right place to track it. **Workaround for a "legit-looking" domain on other transports** Place a reverse proxy (Nginx, Caddy, HAProxy) in front of your Xray instance on port 443. Let the reverse proxy handle TLS, serve your static site by default, and forward only the specific XHTTP/WebSocket path to Xray's inbound (listening on a local port without TLS). This is not overwritten by panel saves and is the standard approach for this use case. --- *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3803
No description provided.