mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5499] [Bug]: Tunnel inbound sockopt change fails: missing field streamSettings.security #3838
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#3838
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 @DenMaxRus on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5499
Describe the bug
When trying to set
sockoptsettings for tunnel inbound I am getting error on save actionstreamSettings.security — Invalid input.securityfield is missing in final json. Ifsecurity: "none"is manually added via json, save completes, but nothing really changes,sockoptdoesn't change. Xray docs say"none" means disabled (default).so it feels like unnecessary check for this field on panel side.How to reproduce the problem
Streamsettings tabSaveExpected behavior
sockoptparams added for tunnel inboundActual behavior
Error popup
streamSettings.security — Invalid inputOR
Sockopt changes doesn't save when
securityfield is manually addedRelevant logs
Screenshots
3x-ui version
3.3.1
Xray-core version
26.6.1,26.6.22
How did you install 3x-ui?
Docker / Docker Compose
Operating system
Ubintu 24.04
Which parts of the panel are affected?
Xray config generation
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 23, 2026):
Two distinct bugs are at play here, both confirmed in the source and both already fixed on
main.Bug 1 — Frontend validation:
streamSettings.security — Invalid inputSecuritySettingsSchemainfrontend/src/schemas/protocols/security/index.tsis a Zod discriminated union keyed onsecurity. In v3.3.1 it only accepted the values'none','tls', and'reality'; anystreamSettingsobject where thesecuritykey was absent (which can happen in the tunnel form path) failed validation with the reported error. The fix — adding a second union branchz.object({ security: z.never().optional() })to handle transportless protocols like tunnel/dokodemo-door — was shipped in the commit that closed #5339 (fix(frontend): TProxy schema, VLESS+XHTTP flow links, clearable Jalali date picker).Bug 2 — Backend normalization silently wipes
streamSettingsfor tunnelnormalizeStreamSettings()ininternal/web/service/inbound.goclearsinbound.StreamSettingsfor any protocol not in a hardcoded whitelist. In v3.3.1,tunnel(dokodemo-door) was absent from that whitelist, so the backend discarded the entirestreamSettings— includingsockopt— on every add and update call. This is why manually inserting"security": "none"in the JSON editor allowed the save to pass frontend validation, but thesockoptchanges still did not persist. The fix addsmodel.Tunnel: trueto the whitelist and was committed asfix(inbound): persist streamSettings for tunnel so sockopt saves.Status
Both commits are on
main(confirmed as ancestors ofa2961fd, today's HEAD) but were merged after the v3.3.1 release (2026-06-12). There is no released version that includes both fixes yet.Workaround until the next release
There is no clean workaround in v3.3.1 for Bug 2: the backend will wipe
sockopton every save regardless of what the frontend sends. If you needsockopt(e.g. for TProxy) on a tunnel inbound before the next release, the only option is to editx-ui.dbdirectly or use the Xray config file rather than the panel UI.This reply was generated automatically; a maintainer may follow up.