[GH-ISSUE #5339] [Bug]: Cannot create TProxy inbound from UI: schema validation failed (streamSettings.security — Invalid input) #3741

Closed
opened 2026-10-31 20:34:37 +07:00 by bsakaguchi · 2 comments
Owner

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

Describe the bug

It is currently impossible to create or edit a TProxy inbound from the 3x-ui web interface following the official XTLS documentation.

When configuring an inbound for TProxy and trying to save it, the UI rejects the configuration with a schema validation error.

How to reproduce the problem

  1. Open Inbounds.
  2. Create a new inbound Tunnel intended for TProxy usage.
  3. Click Save.

Expected behavior

No response

Actual behavior

The configuration cannot be saved because frontend schema validation fails with:

streamSettings.security — Invalid input

Relevant logs


Screenshots

No response

3x-ui version

3.3.1

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

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

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @Kamp11 on GitHub (Jun 15, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5339 ### Describe the bug It is currently impossible to create or edit a TProxy inbound from the 3x-ui web interface following the official XTLS documentation. When configuring an inbound for TProxy and trying to save it, the UI rejects the configuration with a schema validation error. ### How to reproduce the problem 1. Open **Inbounds**. 2. Create a new inbound Tunnel intended for TProxy usage. 3. Click **Save**. ### Expected behavior _No response_ ### Actual behavior The configuration cannot be saved because frontend schema validation fails with: ```text streamSettings.security — Invalid input ``` ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.1 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### 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 - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:34:37 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

The validation failure has a confirmed root cause in the frontend schema layer.

What the schema requires

SecuritySettingsSchema (frontend/src/schemas/protocols/security/index.ts:10-22) is a Zod discriminated union keyed on security. It accepts exactly three values — 'none', 'tls', or 'reality' — and rejects any input where security is absent or holds another value. Absent means the security key is completely missing from the streamSettings object, which is what triggers "Invalid input" at path streamSettings.security.

Why this fires for Tunnel / TProxy

There are two distinct scenarios:

  1. Normal UI path (Sockopt toggle) — should work correctly. When "Tunnel" is selected as the protocol, InboundFormModal.tsx:429-436 calls form.setFieldValue('streamSettings', { security: 'none' }). Enabling the Sockopt switch and selecting "TProxy" from its dropdown only writes to the ['streamSettings', 'sockopt'] sub-path and leaves security: 'none' intact. This path is covered by the regression test at frontend/src/test/inbound-form-adapter.test.ts:136-154.

  2. Advanced editor path — broken when security is omitted. The Advanced tab's Stream slice editor (and the "All" editor) writes whatever JSON the user types directly to the form store via form.setFieldValue('streamSettings', parsedJson). This replaces the entire streamSettings object. The Xray / XTLS documentation example for transparent proxy typically shows a streamSettings that has no security key at all, for example:

    { "streamSettings": { "sockopt": { "tproxy": "tproxy", "mark": 255 } } }
    

    Pasting or typing this in the Advanced editor replaces { security: 'none' } with { sockopt: { … } }, stripping security. The Zod validation then fails with the reported error.

Workaround (immediate)

Configure TProxy entirely through the normal form controls without touching the Advanced editor:

  1. Protocol tab: set Allowed Network to tcp,udp and enable Follow Redirect.
  2. Stream tab: enable the Sockopt switch, then set the TProxy dropdown to TProxy.
  3. Click Save.

If you do need to use the Advanced stream editor, include "security": "none" in your streamSettings JSON:

{
  "streamSettings": {
    "security": "none",
    "sockopt": {
      "tproxy": "tproxy",
      "mark": 255
    }
  }
}

Fix direction for maintainers

The schema fix would be to pre-process streamSettings before validation and default security to 'none' when the key is absent, so inputs from the Advanced editor that omit it are treated as none rather than rejected. Alternatively the Advanced editor's write path in advanced-editors.tsx could merge the incoming value against the existing streamSettings instead of replacing it wholesale.

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

<!-- gh-comment-id:4706159895 --> @github-actions[bot] commented on GitHub (Jun 15, 2026): The validation failure has a confirmed root cause in the frontend schema layer. **What the schema requires** `SecuritySettingsSchema` (`frontend/src/schemas/protocols/security/index.ts:10-22`) is a Zod discriminated union keyed on `security`. It accepts exactly three values — `'none'`, `'tls'`, or `'reality'` — and rejects any input where `security` is absent or holds another value. Absent means the `security` key is completely missing from the `streamSettings` object, which is what triggers "Invalid input" at path `streamSettings.security`. **Why this fires for Tunnel / TProxy** There are two distinct scenarios: 1. **Normal UI path (Sockopt toggle) — should work correctly.** When "Tunnel" is selected as the protocol, `InboundFormModal.tsx:429-436` calls `form.setFieldValue('streamSettings', { security: 'none' })`. Enabling the Sockopt switch and selecting "TProxy" from its dropdown only writes to the `['streamSettings', 'sockopt']` sub-path and leaves `security: 'none'` intact. This path is covered by the regression test at `frontend/src/test/inbound-form-adapter.test.ts:136-154`. 2. **Advanced editor path — broken when `security` is omitted.** The Advanced tab's Stream slice editor (and the "All" editor) writes whatever JSON the user types directly to the form store via `form.setFieldValue('streamSettings', parsedJson)`. This replaces the entire `streamSettings` object. The Xray / XTLS documentation example for transparent proxy typically shows a `streamSettings` that has no `security` key at all, for example: ```json { "streamSettings": { "sockopt": { "tproxy": "tproxy", "mark": 255 } } } ``` Pasting or typing this in the Advanced editor replaces `{ security: 'none' }` with `{ sockopt: { … } }`, stripping `security`. The Zod validation then fails with the reported error. **Workaround (immediate)** Configure TProxy entirely through the normal form controls without touching the Advanced editor: 1. Protocol tab: set **Allowed Network** to `tcp,udp` and enable **Follow Redirect**. 2. Stream tab: enable the **Sockopt** switch, then set the **TProxy** dropdown to **TProxy**. 3. Click Save. If you do need to use the Advanced stream editor, include `"security": "none"` in your `streamSettings` JSON: ```json { "streamSettings": { "security": "none", "sockopt": { "tproxy": "tproxy", "mark": 255 } } } ``` **Fix direction for maintainers** The schema fix would be to pre-process `streamSettings` before validation and default `security` to `'none'` when the key is absent, so inputs from the Advanced editor that omit it are treated as `none` rather than rejected. Alternatively the Advanced editor's write path in `advanced-editors.tsx` could merge the incoming value against the existing `streamSettings` instead of replacing it wholesale. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@MHSanaei commented on GitHub (Jun 15, 2026):

Fixed on main in f00512d1. The frontend schema now accepts transportless tunnel/TProxy streamSettings that carry no security key, so saving a TProxy inbound no longer fails with streamSettings.security — Invalid input. Ships in the next release.

<!-- gh-comment-id:4709486979 --> @MHSanaei commented on GitHub (Jun 15, 2026): Fixed on `main` in f00512d1. The frontend schema now accepts transportless tunnel/TProxy `streamSettings` that carry no `security` key, so saving a TProxy inbound no longer fails with *streamSettings.security — Invalid input*. Ships in the next release.
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#3741
No description provided.