mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5720] XHTTP xmux settings saved in DB but not propagated to generated Xray config #3980
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#3980
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 @Nelmi0 on GitHub (Jul 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5720
Title: XHTTP xmux settings saved in DB but not propagated to generated Xray config
Environment
xhttp, securitytlsDescription
xmuxis a fully supported field ofXhttpSettings/XmuxConfigin Xray-core 26.6.27 (confirmed via binary symbols:maxConcurrency,maxConnections,cMaxReuseTimes,hMaxRequestTimes,hMaxReusableSecs,hKeepAlivePeriod, all present with correct JSON tags in the compiled binary, plus runtime log strings likeXMUX: creating xmuxClient because maxConcurrency was hit).However, when
xmuxis written into thexhttpSettingsobject of an inbound'sstream_settingsin the x-ui SQLite database (/etc/x-ui/x-ui.db, tableinbounds, columnstream_settings), it does not appear in the actual Xray runtime config generated by x-ui (bin/config.json) after a service restart. The field is silently dropped — no error is logged, Xray starts normally without it.There is no UI field for
xmuxeither (checkedgrep -r "xmux" /usr/local/x-ui/web/→ 0 matches), so this can currently only be attempted via direct DB edits, and even that path is broken.Steps to reproduce
systemctl stop x-uistream_settingsin/etc/x-ui/x-ui.db(tableinbounds), adding anxmuxobject insidexhttpSettings, e.g.:systemctl start x-ui(orrestart)bin/config.json(relative to x-ui's working directory,/usr/local/x-ui/bin/config.json)Expected
The
xmuxobject should appear inside the corresponding inbound'sstreamSettings.xhttpSettingsinbin/config.json, matching what was stored in the DB.Actual
xmuxis missing entirely frombin/config.json'sxhttpSettings— onlyhost,mode,path,scStreamUpServerSecs,xPaddingBytesare present. No errors injournalctl -u x-ui; Xray starts and serves traffic normally, just without the xmux tuning applied.Additional notes
xhttpSettingsstruct (thexmuxsub-object is either not included in the Go struct used for marshaling to Xray's config format, or is dropped during the DB-model → Xray-config translation step).@github-actions[bot] commented on GitHub (Jul 1, 2026):
This is expected behavior, not a bug —
xmuxis intentionally stripped from an inbound'sxhttpSettingsbefore the Xray runtime config is generated.Confirmed in source
internal/database/model/model.godefinesStripInboundXhttpClientFields(lines 232-273), which is called fromGenXrayInboundConfig(line 299) whenever an inbound'snetworkisxhttp. It deletes these keys fromxhttpSettingsbefore the config is handed to the Xray process:The function's doc comment states the rationale directly:
This is covered by unit tests in
internal/database/model/model_test.go(TestStripInboundXhttpClientFields_RemovesClientOnlyKnobs,TestGenXrayInboundConfig_OmitsInboundXmuxButDbRowUnchanged), which explicitly assertxmuxmust NOT appear in the generated Xray config while it must still survive in the raw DB row'sstream_settings.That's also why the value you wrote into the DB isn't lost: the raw JSON stored in the
inboundstable is left untouched, andinternal/sub/service.go(buildXhttpExtra) readsxmuxstraight out of it to forward to clients via subscription links/share-link extras. Only the Xray-facing config generation strips it.Why the panel does this
The maintainer explained the same rationale when closing #5194 (a related request to add
xmuxfields to the inbound UI):xmuxis a client-side/outbound dialer setting, and xray-core's XHTTP inbound (server) does not consume it, so the panel intentionally omits/strips it there. It remains fully configurable where it does take effect — the outbound XHTTP form (frontend/src/pages/xray/outbounds/transport/xhttp.tsx), which has a complete toggle-gated XMUX section with all six knobs (maxConcurrency,maxConnections,cMaxReuseTimes,hMaxRequestTimes,hMaxReusableSecs,hKeepAlivePeriod).So there is no config-generation gap or silent-drop bug: the DB retains
xmuxfor subscription purposes, and the Xray inbound config deliberately omits it because the inbound side has nothing to do with it.This reply was generated automatically; a maintainer may follow up if further clarification is needed.