mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #5349] [MERGED] fix(inbound): strip XHTTP XMUX from xray config, keep for subscriptions #5853
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#5853
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5349
Author: @nima1024m
Created: 6/15/2026
Status: ✅ Merged
Merged: 6/15/2026
Merged by: @MHSanaei
Base:
main← Head:fix/inbound-xhttp-xmux-strip-from-xray-config📝 Commits (1)
c30d4a6fix(inbound): strip XHTTP client-only fields from xray config, keep for subscriptions📊 Changes
3 files changed (+131 additions, -2 deletions)
View changed files
📝
frontend/src/test/stream-wire-normalize.test.ts(+1 -1)📝
internal/database/model/model.go(+48 -1)📝
internal/database/model/model_test.go(+82 -0)📄 Description
Summary
xmux,downloadSettings,scMinPostsIntervalMs,uplinkChunkSize,noGRPCHeader) from the xray-core inbound config atGenXrayInboundConfigtimestreamSettingsunchanged so subscription/share-link generation (buildXhttpExtra) still delivers XMUX defaults to clientsbin/config.jsoneven though xray-core's XHTTP server listener ignores themProblem
When XMUX is enabled on an XHTTP inbound, 3x-ui correctly stores
xmuxin the database (for pushing client defaults via subscriptions). However,GenXrayInboundConfigpassedstreamSettingsthrough verbatim, soxmuxalso appeared inbin/config.jsonand in live gRPC inbound reloads. xray-core only consumes XMUX on the client/outbound dialer — not on the server inbound.Solution
Add
StripInboundXhttpClientFields()ininternal/database/model/model.go, following the existingStripVmessClientSecurity/StripVlessInboundEncryptionpattern. Call it fromGenXrayInboundConfigso both config.json generation (GetXrayConfig) and live inbound reload (runtime.Local.AddInbound) omit client-only fields without touching the stored inbound row.Behaviour after this change
streamSettingsbin/config.jsonserver inboundextraTest plan
go test ./internal/database/model/... -run "Xhttp|Xmux|StripInbound"go test ./internal/sub/... -run XhttpExtra(subscription extra blob unaffected)npx vitest run src/test/stream-wire-normalize.test.ts(frontend inbound save path unchanged)Manual verification suggested:
maxConcurrencystreamSettings—xmuxshould still be presentbin/config.json(or panel → Xray → view config) — inboundxhttpSettingsmust not containxmuxextrablob should still includexmuxFiles changed
internal/database/model/model.go—StripInboundXhttpClientFields, wired intoGenXrayInboundConfiginternal/database/model/model_test.go— strip + GenXray regression testsfrontend/src/test/stream-wire-normalize.test.ts— clarify test description (no logic change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.