[GH-ISSUE #6332] [Feature]: Allow xtls-rprx-vision on VLESS + TCP + security:none when VLESS Encryption is enabled #4300

Open
opened 2026-10-31 20:38:40 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @BaseBlank on GitHub (Aug 26, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6332

3x-ui version is v3.6.0

When creating or editing a VLESS inbound with the following settings:

  • Transport: RAW / TCP
  • Security: none
  • VLESS Encryption enabled (e.g. mlkem768x25519plus.native...)

the panel currently forces flow to empty (both in the UI and in the generated Xray config / share links).

This is intentional in the current gating logic. From the test cases in the codebase:

// vlessenc (ML-KEM) keeps Vision flow without transport TLS only on XHTTP.
// TCP without tls/reality clears it even with vlessenc set.
{ "vless tcp vlessenc clears flow", ..., `{"network":"tcp","security":"none"}`, enc, "" },
{ "vless xhttp vlessenc keeps flow", ..., `{"network":"xhttp","security":"none"}`, enc, vision },

(See commit c7a76e9 and related changes to inboundCanEnableTlsFlow.)

However, Xray-core itself already supports this combination. In proxy/vless/outbound/outbound.go, Vision explicitly accepts *encryption.CommonConn:

if commonConn, ok := conn.(*encryption.CommonConn); ok {
    // Vision path is allowed
} else if tlsConn ... {
} else if realityConn ... {
} else {
    return errors.New("XTLS only supports TLS and REALITY directly for now.")
}

Official Xray documentation also lists “VLESS Encryption” as a valid combination for XTLS/Vision (no underlying transport restriction).

So the core supports the configuration, but the panel actively prevents users from enabling it on TCP + security:none.


Describe the solution you'd like

Extend inboundCanEnableTlsFlow (and the corresponding frontend canEnableTlsFlow check) so that:

  • When protocol == VLESS
  • AND network is tcp / raw
  • AND security == "none"
  • AND VLESS Encryption is present and not "none" (i.e. a real mlkem768x25519plus... value exists in settings)

→ flow / xtls-rprx-vision should be allowed (same as the existing XHTTP + Encryption case).

Expected behavior:

  • The Flow selector appears in the client form when the above conditions are met.
  • Generated Xray config and share links include "flow": "xtls-rprx-vision" when the user sets it.
  • Existing XHTTP + Encryption behavior remains unchanged.

Alternatives you've considered

  • Manually editing the generated config.json after the panel saves it (works, but is fragile and gets overwritten on next panel save / restart).
  • Switching the transport to XHTTP just to unlock Flow (unnecessary when TCP is preferred).
  • Leaving Flow empty (functionally works for many use cases, but loses the Vision optimization that the core already supports).

None of these are ideal compared to the panel simply allowing a combination that Xray-core already accepts.


Concrete use case

Landing / exit node scenarios that use VLESS Encryption for authentication and PFS, with security: none + RAW/TCP (no need for TLS/REALITY camouflage on the landing side).

In these setups the operator wants the option to enable xtls-rprx-vision for the data-path optimization that Vision provides (direct-copy / potential splice after the inner TLS is detected), without being forced to switch to XHTTP or manually patch the config.

Mockups, screenshots, or examples

Current gating (from existing tests):

TCP + security:none + Encryption  → flow cleared
XHTTP + security:none + Encryption → flow allowed

Desired:

TCP + security:none + Encryption  → flow allowed (same as XHTTP case)

No UI mockup needed — simply make the Flow selector appear under the same conditions that already apply to XHTTP + Encryption, and stop stripping the flow value in clientWithInboundFlow / config generation for this combination.


Which parts of the panel would this affect?

Xray config generation, Frontend (UI / panel pages)

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @BaseBlank on GitHub (Aug 26, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6332 3x-ui version is v3.6.0 ### Is your feature request related to a problem? When creating or editing a VLESS inbound with the following settings: - Transport: RAW / TCP - Security: none - VLESS Encryption enabled (e.g. `mlkem768x25519plus.native...`) the panel currently forces `flow` to empty (both in the UI and in the generated Xray config / share links). This is intentional in the current gating logic. From the test cases in the codebase: ```go // vlessenc (ML-KEM) keeps Vision flow without transport TLS only on XHTTP. // TCP without tls/reality clears it even with vlessenc set. { "vless tcp vlessenc clears flow", ..., `{"network":"tcp","security":"none"}`, enc, "" }, { "vless xhttp vlessenc keeps flow", ..., `{"network":"xhttp","security":"none"}`, enc, vision }, ``` (See commit `c7a76e9` and related changes to `inboundCanEnableTlsFlow`.) However, Xray-core itself already supports this combination. In `proxy/vless/outbound/outbound.go`, Vision explicitly accepts `*encryption.CommonConn`: ```go if commonConn, ok := conn.(*encryption.CommonConn); ok { // Vision path is allowed } else if tlsConn ... { } else if realityConn ... { } else { return errors.New("XTLS only supports TLS and REALITY directly for now.") } ``` Official Xray documentation also lists “VLESS Encryption” as a valid combination for XTLS/Vision (no underlying transport restriction). So the core supports the configuration, but the panel actively prevents users from enabling it on TCP + security:none. --- ### Describe the solution you'd like Extend `inboundCanEnableTlsFlow` (and the corresponding frontend `canEnableTlsFlow` check) so that: - When `protocol == VLESS` - AND `network` is `tcp` / `raw` - AND `security == "none"` - AND VLESS Encryption is present and not `"none"` (i.e. a real `mlkem768x25519plus...` value exists in settings) → `flow` / `xtls-rprx-vision` should be allowed (same as the existing XHTTP + Encryption case). Expected behavior: - The Flow selector appears in the client form when the above conditions are met. - Generated Xray config and share links include `"flow": "xtls-rprx-vision"` when the user sets it. - Existing XHTTP + Encryption behavior remains unchanged. ### Alternatives you've considered - Manually editing the generated `config.json` after the panel saves it (works, but is fragile and gets overwritten on next panel save / restart). - Switching the transport to XHTTP just to unlock Flow (unnecessary when TCP is preferred). - Leaving Flow empty (functionally works for many use cases, but loses the Vision optimization that the core already supports). None of these are ideal compared to the panel simply allowing a combination that Xray-core already accepts. --- ### Concrete use case Landing / exit node scenarios that use VLESS Encryption for authentication and PFS, with `security: none` + RAW/TCP (no need for TLS/REALITY camouflage on the landing side). In these setups the operator wants the option to enable `xtls-rprx-vision` for the data-path optimization that Vision provides (direct-copy / potential splice after the inner TLS is detected), without being forced to switch to XHTTP or manually patch the config. ### Mockups, screenshots, or examples Current gating (from existing tests): ```text TCP + security:none + Encryption → flow cleared XHTTP + security:none + Encryption → flow allowed ``` Desired: ```text TCP + security:none + Encryption → flow allowed (same as XHTTP case) ``` No UI mockup needed — simply make the Flow selector appear under the same conditions that already apply to XHTTP + Encryption, and stop stripping the flow value in `clientWithInboundFlow` / config generation for this combination. --- ### Which parts of the panel would this affect? Xray config generation, Frontend (UI / panel pages) ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2026):

Your reading of the panel is correct, and the restriction is deliberate rather than an oversight: the flow gate accepts VLESS Encryption as a stand-in for transport TLS only on XHTTP, so RAW/TCP + security: none + Encryption clears flow on every surface at once. That makes this a valid feature request. The premise it rests on — that Xray-core accepts Vision on a raw TCP stream carrying only VLESS Encryption — is the one thing I could not verify here, and the repo currently asserts the opposite, so there are two questions at the bottom.

What the panel does today

internal/web/service/inbound_protocol.go:46-53:

switch stream.Network {
case "tcp":
	return stream.Security == "tls" || stream.Security == "reality"
case "xhttp":
	return vlessEncryptionEnabled(settings)
default:
	return false
}

The UI's RAW option stores network: "tcp" (frontend/src/pages/inbounds/form/InboundFormModal.tsx:879 — { value: 'tcp', label: 'RAW' }), so RAW is exactly this case "tcp" branch.

That one predicate is mirrored in four more places, which is why the value disappears from the form, the config and the links together:

surface file:line
client add / update / copy (c.Flow = "") internal/web/service/client_crud.go:288-292, internal/web/service/inbound_clients.go:227, internal/web/service/client_bulk.go:586-588
the tlsFlowCapable flag that shows/hides the Flow selector internal/web/service/inbound.go:379 → frontend/src/pages/clients/ClientFormModal.tsx:472 and :512-519 (which also clears an already-set flow)
subscriptions / links served by the panel internal/sub/service.go:913-921 (vlessFlowAllowed), internal/sub/json_service.go:527
the link the panel UI renders frontend/src/lib/xray/inbound-link.ts:474-486 → frontend/src/lib/xray/protocol-capabilities.ts:60-72

It is intentional, and pinned by tests

The XHTTP allowance came in c7a76e96 (2026-06-11, "fix: enable XTLS vision flow for VLESS+XHTTP+vlessenc in UI and share links (#5157) (#5185)"), whose message ends:

Scope is XHTTP-only: TCP without tls/reality is intentionally excluded.

The same commit added the test that locks it, internal/web/service/inbound_protocol_test.go:29-32:

// vlessenc is gated to XHTTP only. TCP without tls/reality is NOT
// Vision-capable even with vlessenc set — the combination only works on
// XHTTP in practice.
{"vless tcp vlessenc not capable", string(model.VLESS), `{"network":"tcp","security":"none"}`, `{"decryption":"mlkem768x25519plus...","encryption":"mlkem768x25519plus..."}`, false},

with the mirrors asserted in internal/sub/service_flow_test.go:29 ({"tcp none vlessenc", "tcp", "none", enc, false}) and frontend/src/test/inbound-from-db.test.ts:225-232 ("vlessenc is XHTTP-only: TCP without tls/reality is not Vision-capable"). Granting this request therefore means reversing a claim the codebase currently makes in prose, in four implementations and in three test files — which is why the evidence for it matters more than usual.

What I could not check

Xray-core is not part of this checkout and this environment has no network access, so I could not open proxy/vless/outbound/outbound.go, confirm the *encryption.CommonConn branch you quoted, or read the documentation sentence you refer to. For reference, the panel compiles against github.com/xtls/xray-core v1.260327.1-0.20260728075948-5ca6f4b7d4dc (go.mod:28) and bundles the v26.7.28 binary (DockerInit.sh:35).

So that the premise can be checked rather than taken on trust, please add:

  1. The exact upstream reference — repo tag, file and line — for the *encryption.CommonConn acceptance, in proxy/vless/inbound/inbound.go as well as the outbound file you quoted (the panel configures the server side, and the two have historically had different flow checks), plus the URL of the documentation sentence.
  2. The result of an actual run of RAW/TCP + security: none + Encryption + xtls-rprx-vision against Xray v26.7.28 or newer: does traffic pass end to end, or does the connection fail after the handshake? Paste the server and client Xray log lines as text (I cannot open images), and name the client app and version — it has to accept Vision without transport TLS too.

A workaround that survives a panel restart

Editing config.json is overwritten because the panel regenerates it from the database. Setting flow at the inbound level instead is not gated and does persist: AddInbound/UpdateInbound store settings verbatim and only strip flows when the inbound's Disable flow switch is on (internal/web/service/inbound.go:988-995), and GenXrayInboundConfig passes settings.clients[] through untouched (internal/database/model/model.go:343-391 — for VLESS it removes only the top-level encryption key, never flow). So:

curl -X POST "https://<panel>/<base-path>/panel/api/inbounds/update/<id>" \
  -H "Content-Type: application/json" -b cookies.txt \
  -d '{"id":<id>,"settings":"{\"clients\":[{\"id\":\"<uuid>\",\"email\":\"user1\",\"flow\":\"xtls-rprx-vision\"}],\"decryption\":\"mlkem768x25519plus...\"}", ...}'

Three caveats, all verified above: the panel's own share links and subscriptions will still omit flow= for this combination (internal/sub/service.go:913-921), so subscribers must add it client-side; editing that client through the client modal or the client API clears it again (internal/web/service/client_crud.go:289-291); and turning on Disable flow wipes it. Only do this once question 2 above answers "traffic passes" for your build.

Verdict: Feature request

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

<!-- gh-comment-id:5419675128 --> @github-actions[bot] commented on GitHub (Aug 26, 2026): Your reading of the panel is correct, and the restriction is deliberate rather than an oversight: the flow gate accepts VLESS Encryption as a stand-in for transport TLS **only** on XHTTP, so RAW/TCP + `security: none` + Encryption clears `flow` on every surface at once. That makes this a valid feature request. The premise it rests on — that Xray-core accepts Vision on a raw TCP stream carrying only VLESS Encryption — is the one thing I could **not** verify here, and the repo currently asserts the opposite, so there are two questions at the bottom. ## What the panel does today `internal/web/service/inbound_protocol.go:46-53`: ```go switch stream.Network { case "tcp": return stream.Security == "tls" || stream.Security == "reality" case "xhttp": return vlessEncryptionEnabled(settings) default: return false } ``` The UI's **RAW** option stores `network: "tcp"` (`frontend/src/pages/inbounds/form/InboundFormModal.tsx:879` — `{ value: 'tcp', label: 'RAW' }`), so RAW is exactly this `case "tcp"` branch. That one predicate is mirrored in four more places, which is why the value disappears from the form, the config and the links together: | surface | file:line | | --- | --- | | client add / update / copy (`c.Flow = ""`) | `internal/web/service/client_crud.go:288-292`, `internal/web/service/inbound_clients.go:227`, `internal/web/service/client_bulk.go:586-588` | | the `tlsFlowCapable` flag that shows/hides the Flow selector | `internal/web/service/inbound.go:379` → `frontend/src/pages/clients/ClientFormModal.tsx:472` and `:512-519` (which also clears an already-set flow) | | subscriptions / links served by the panel | `internal/sub/service.go:913-921` (`vlessFlowAllowed`), `internal/sub/json_service.go:527` | | the link the panel UI renders | `frontend/src/lib/xray/inbound-link.ts:474-486` → `frontend/src/lib/xray/protocol-capabilities.ts:60-72` | ## It is intentional, and pinned by tests The XHTTP allowance came in `c7a76e96` (2026-06-11, *"fix: enable XTLS vision flow for VLESS+XHTTP+vlessenc in UI and share links (#5157) (#5185)"*), whose message ends: > Scope is XHTTP-only: TCP without tls/reality is intentionally excluded. The same commit added the test that locks it, `internal/web/service/inbound_protocol_test.go:29-32`: ```go // vlessenc is gated to XHTTP only. TCP without tls/reality is NOT // Vision-capable even with vlessenc set — the combination only works on // XHTTP in practice. {"vless tcp vlessenc not capable", string(model.VLESS), `{"network":"tcp","security":"none"}`, `{"decryption":"mlkem768x25519plus...","encryption":"mlkem768x25519plus..."}`, false}, ``` with the mirrors asserted in `internal/sub/service_flow_test.go:29` (`{"tcp none vlessenc", "tcp", "none", enc, false}`) and `frontend/src/test/inbound-from-db.test.ts:225-232` (*"vlessenc is XHTTP-only: TCP without tls/reality is not Vision-capable"*). Granting this request therefore means reversing a claim the codebase currently makes in prose, in four implementations and in three test files — which is why the evidence for it matters more than usual. ## What I could not check Xray-core is not part of this checkout and this environment has no network access, so I could not open `proxy/vless/outbound/outbound.go`, confirm the `*encryption.CommonConn` branch you quoted, or read the documentation sentence you refer to. For reference, the panel compiles against `github.com/xtls/xray-core v1.260327.1-0.20260728075948-5ca6f4b7d4dc` (`go.mod:28`) and bundles the `v26.7.28` binary (`DockerInit.sh:35`). So that the premise can be checked rather than taken on trust, please add: 1. The exact upstream reference — repo tag, file and line — for the `*encryption.CommonConn` acceptance, in **`proxy/vless/inbound/inbound.go`** as well as the outbound file you quoted (the panel configures the server side, and the two have historically had different flow checks), plus the URL of the documentation sentence. 2. The result of an actual run of RAW/TCP + `security: none` + Encryption + `xtls-rprx-vision` against Xray v26.7.28 or newer: does traffic pass end to end, or does the connection fail after the handshake? Paste the server and client Xray log lines as text (I cannot open images), and name the client app and version — it has to accept Vision without transport TLS too. ## A workaround that survives a panel restart Editing `config.json` is overwritten because the panel regenerates it from the database. Setting `flow` at the **inbound** level instead is not gated and does persist: `AddInbound`/`UpdateInbound` store `settings` verbatim and only strip flows when the inbound's *Disable flow* switch is on (`internal/web/service/inbound.go:988-995`), and `GenXrayInboundConfig` passes `settings.clients[]` through untouched (`internal/database/model/model.go:343-391` — for VLESS it removes only the top-level `encryption` key, never `flow`). So: ```bash curl -X POST "https://<panel>/<base-path>/panel/api/inbounds/update/<id>" \ -H "Content-Type: application/json" -b cookies.txt \ -d '{"id":<id>,"settings":"{\"clients\":[{\"id\":\"<uuid>\",\"email\":\"user1\",\"flow\":\"xtls-rprx-vision\"}],\"decryption\":\"mlkem768x25519plus...\"}", ...}' ``` Three caveats, all verified above: the panel's own share links and subscriptions will still omit `flow=` for this combination (`internal/sub/service.go:913-921`), so subscribers must add it client-side; editing that client through the client modal or the client API clears it again (`internal/web/service/client_crud.go:289-291`); and turning on *Disable flow* wipes it. Only do this once question 2 above answers "traffic passes" for your build. Verdict: Feature request *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@APT-ZERO commented on GitHub (Sep 24, 2026):

+1
I have the same issue

<!-- gh-comment-id:5814763129 --> @APT-ZERO commented on GitHub (Sep 24, 2026): +1 I have the same issue
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#4300
No description provided.