[GH-ISSUE #5720] XHTTP xmux settings saved in DB but not propagated to generated Xray config #3980

Closed
opened 2026-10-31 20:36:18 +07:00 by bsakaguchi · 1 comment
Owner

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

  • x-ui version: 3.4.2 (also reproduced on 3.4.1)
  • Xray-core version: 26.6.27 (go1.26.4 linux/amd64)
  • OS: Linux, kernel 6.8.0-134-generic
  • Inbound: VLESS, network xhttp, security tls

Description

xmux is a fully supported field of XhttpSettings/XmuxConfig in 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 like XMUX: creating xmuxClient because maxConcurrency was hit).

However, when xmux is written into the xhttpSettings object of an inbound's stream_settings in the x-ui SQLite database (/etc/x-ui/x-ui.db, table inbounds, column stream_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 xmux either (checked grep -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

  1. Stop x-ui: systemctl stop x-ui
  2. Edit the inbound's stream_settings in /etc/x-ui/x-ui.db (table inbounds), adding an xmux object inside xhttpSettings, e.g.:
    "xhttpSettings": {
      "path": "/",
      "host": "",
      "mode": "stream-up",
      "xPaddingBytes": "100-1000",
      "scStreamUpServerSecs": "20-80",
      "xmux": {
        "maxConcurrency": 0,
        "cMaxReuseTimes": 0,
        "hMaxRequestTimes": 0,
        "hMaxReusableSecs": 0,
        "hKeepAlivePeriod": 60
      }
    }
    
  3. Start x-ui: systemctl start x-ui (or restart)
  4. Inspect the generated Xray config: bin/config.json (relative to x-ui's working directory, /usr/local/x-ui/bin/config.json)

Expected

The xmux object should appear inside the corresponding inbound's streamSettings.xhttpSettings in bin/config.json, matching what was stored in the DB.

Actual

xmux is missing entirely from bin/config.json's xhttpSettings — only host, mode, path, scStreamUpServerSecs, xPaddingBytes are present. No errors in journalctl -u x-ui; Xray starts and serves traffic normally, just without the xmux tuning applied.

Additional notes

  • This appears to be a gap in x-ui's config-generation/serialization layer for the xhttpSettings struct (the xmux sub-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).
  • Since there's also no UI support for this field, users currently have no working way to configure XHTTP xmux tuning through x-ui, despite Xray-core fully supporting it.
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 - x-ui version: 3.4.2 (also reproduced on 3.4.1) - Xray-core version: 26.6.27 (go1.26.4 linux/amd64) - OS: Linux, kernel 6.8.0-134-generic - Inbound: VLESS, network `xhttp`, security `tls` ## Description `xmux` is a fully supported field of `XhttpSettings`/`XmuxConfig` in 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 like `XMUX: creating xmuxClient because maxConcurrency was hit`). However, when `xmux` is written into the `xhttpSettings` object of an inbound's `stream_settings` in the x-ui SQLite database (`/etc/x-ui/x-ui.db`, table `inbounds`, column `stream_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 `xmux` either (checked `grep -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 1. Stop x-ui: `systemctl stop x-ui` 2. Edit the inbound's `stream_settings` in `/etc/x-ui/x-ui.db` (table `inbounds`), adding an `xmux` object inside `xhttpSettings`, e.g.: ```json "xhttpSettings": { "path": "/", "host": "", "mode": "stream-up", "xPaddingBytes": "100-1000", "scStreamUpServerSecs": "20-80", "xmux": { "maxConcurrency": 0, "cMaxReuseTimes": 0, "hMaxRequestTimes": 0, "hMaxReusableSecs": 0, "hKeepAlivePeriod": 60 } } ``` 3. Start x-ui: `systemctl start x-ui` (or `restart`) 4. Inspect the generated Xray config: `bin/config.json` (relative to x-ui's working directory, `/usr/local/x-ui/bin/config.json`) ## Expected The `xmux` object should appear inside the corresponding inbound's `streamSettings.xhttpSettings` in `bin/config.json`, matching what was stored in the DB. ## Actual `xmux` is missing entirely from `bin/config.json`'s `xhttpSettings` — only `host`, `mode`, `path`, `scStreamUpServerSecs`, `xPaddingBytes` are present. No errors in `journalctl -u x-ui`; Xray starts and serves traffic normally, just without the xmux tuning applied. ## Additional notes - This appears to be a gap in x-ui's config-generation/serialization layer for the `xhttpSettings` struct (the `xmux` sub-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). - Since there's also no UI support for this field, users currently have no working way to configure XHTTP xmux tuning through x-ui, despite Xray-core fully supporting it.
bsakaguchi 2026-10-31 20:36:18 +07:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jul 1, 2026):

This is expected behavior, not a bug — xmux is intentionally stripped from an inbound's xhttpSettings before the Xray runtime config is generated.

Confirmed in source

internal/database/model/model.go defines StripInboundXhttpClientFields (lines 232-273), which is called from GenXrayInboundConfig (line 299) whenever an inbound's network is xhttp. It deletes these keys from xhttpSettings before the config is handed to the Xray process:

clientOnly := []string{
    "xmux",
    "downloadSettings",
    "scMinPostsIntervalMs",
    "uplinkChunkSize",
    "noGRPCHeader",
}

The function's doc comment states the rationale directly:

xHTTP knobs that belong on the client dialer and subscription share-link extras only. xray-core's XHTTP inbound listener does not consume them; the panel still stores them on the inbound row so buildXhttpExtra can push defaults to clients.

This is covered by unit tests in internal/database/model/model_test.go (TestStripInboundXhttpClientFields_RemovesClientOnlyKnobs, TestGenXrayInboundConfig_OmitsInboundXmuxButDbRowUnchanged), which explicitly assert xmux must NOT appear in the generated Xray config while it must still survive in the raw DB row's stream_settings.

That's also why the value you wrote into the DB isn't lost: the raw JSON stored in the inbounds table is left untouched, and internal/sub/service.go (buildXhttpExtra) reads xmux straight 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 xmux fields to the inbound UI): xmux is 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 xmux for 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.

<!-- gh-comment-id:4858847817 --> @github-actions[bot] commented on GitHub (Jul 1, 2026): This is expected behavior, not a bug — `xmux` is intentionally stripped from an inbound's `xhttpSettings` before the Xray runtime config is generated. **Confirmed in source** `internal/database/model/model.go` defines `StripInboundXhttpClientFields` (lines 232-273), which is called from `GenXrayInboundConfig` (line 299) whenever an inbound's `network` is `xhttp`. It deletes these keys from `xhttpSettings` before the config is handed to the Xray process: ```go clientOnly := []string{ "xmux", "downloadSettings", "scMinPostsIntervalMs", "uplinkChunkSize", "noGRPCHeader", } ``` The function's doc comment states the rationale directly: > xHTTP knobs that belong on the client dialer and subscription share-link extras only. xray-core's XHTTP inbound listener does not consume them; the panel still stores them on the inbound row so buildXhttpExtra can push defaults to clients. This is covered by unit tests in `internal/database/model/model_test.go` (`TestStripInboundXhttpClientFields_RemovesClientOnlyKnobs`, `TestGenXrayInboundConfig_OmitsInboundXmuxButDbRowUnchanged`), which explicitly assert `xmux` must NOT appear in the generated Xray config while it must still survive in the raw DB row's `stream_settings`. That's also why the value you wrote into the DB isn't lost: the raw JSON stored in the `inbounds` table is left untouched, and `internal/sub/service.go` (`buildXhttpExtra`) reads `xmux` straight 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 `xmux` fields to the inbound UI): `xmux` is 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 `xmux` for 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.*
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#3980
No description provided.