mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5339] [Bug]: Cannot create TProxy inbound from UI: schema validation failed (streamSettings.security — Invalid input) #3741
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#3741
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 @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
Expected behavior
No response
Actual behavior
The configuration cannot be saved because frontend schema validation fails with:
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
@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 onsecurity. It accepts exactly three values —'none','tls', or'reality'— and rejects any input wheresecurityis absent or holds another value. Absent means thesecuritykey is completely missing from thestreamSettingsobject, which is what triggers "Invalid input" at pathstreamSettings.security.Why this fires for Tunnel / TProxy
There are two distinct scenarios:
Normal UI path (Sockopt toggle) — should work correctly. When "Tunnel" is selected as the protocol,
InboundFormModal.tsx:429-436callsform.setFieldValue('streamSettings', { security: 'none' }). Enabling the Sockopt switch and selecting "TProxy" from its dropdown only writes to the['streamSettings', 'sockopt']sub-path and leavessecurity: 'none'intact. This path is covered by the regression test atfrontend/src/test/inbound-form-adapter.test.ts:136-154.Advanced editor path — broken when
securityis omitted. The Advanced tab's Stream slice editor (and the "All" editor) writes whatever JSON the user types directly to the form store viaform.setFieldValue('streamSettings', parsedJson). This replaces the entirestreamSettingsobject. The Xray / XTLS documentation example for transparent proxy typically shows astreamSettingsthat has nosecuritykey at all, for example:Pasting or typing this in the Advanced editor replaces
{ security: 'none' }with{ sockopt: { … } }, strippingsecurity. The Zod validation then fails with the reported error.Workaround (immediate)
Configure TProxy entirely through the normal form controls without touching the Advanced editor:
tcp,udpand enable Follow Redirect.If you do need to use the Advanced stream editor, include
"security": "none"in yourstreamSettingsJSON:Fix direction for maintainers
The schema fix would be to pre-process
streamSettingsbefore validation and defaultsecurityto'none'when the key is absent, so inputs from the Advanced editor that omit it are treated asnonerather than rejected. Alternatively the Advanced editor's write path inadvanced-editors.tsxcould merge the incoming value against the existingstreamSettingsinstead of replacing it wholesale.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jun 15, 2026):
Fixed on
maininf00512d1. The frontend schema now accepts transportless tunnel/TProxystreamSettingsthat carry nosecuritykey, so saving a TProxy inbound no longer fails with streamSettings.security — Invalid input. Ships in the next release.