[GH-ISSUE #5890] [Bug]: External nodes inbound settings #4083

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

Originally created by @beevar-u on GitHub (Jul 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5890

Describe the bug

I have two nodes (A and B). Both nodes use the same scheme:
Internet -> Caddy - > 3X-UI (xhttp)
xhttp configured without tls, host configured with tls and Fingerprint.
Node A configured to manage node B (Nodes settings) using token.

Node A client, assigned with imported inbound from Node B, don't get tls/fingerprint setting in config.
So outbound setting on Node A looks like

      {
        "protocol": "vless",
        "tag": "proxy",
        "streamSettings": {
          "network": "xhttp",
          "security": "tls",
          "tlsSettings": {},
          "xhttpSettings": {
            "host": "hostB.org",
            "mode": "packet-up",
            "path": "/xhttp/",
            "xPaddingBytes": "100-1000"
          }
        },

But same outbound on Node B

    {
      "protocol": "vless",
      "tag": "proxy",
      "streamSettings": {
        "network": "xhttp",
        "security": "tls",
        "tlsSettings": {
          "fingerprint": "firefox",
          "serverName": "hostB.org",
          "settings": {
            "fingerprint": "firefox"
          }
        },
        "xhttpSettings": {
          "host": "hostB.org",
          "mode": "packet-up",
          "path": "/xhttp/",
          "xPaddingBytes": "100-1000"
        }
      }

How to reproduce the problem

  1. Setup two nodes with xthhp (no tls) behind reverse proxy and provide fingerprint setting in host settings
  2. Setup one node to manage another
  3. Setup client on first node and assign second node inbound

Expected behavior

Client on first node get all related inbound settings from managed node, including fingerprint

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.4.2

Xray-core version

v26.6.27

How did you install 3x-ui?

Docker / Docker Compose

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Subscription (share links / Clash / JSON)

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @beevar-u on GitHub (Jul 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5890 ### Describe the bug I have two nodes (A and B). Both nodes use the same scheme: `Internet` -> `Caddy` - > `3X-UI (xhttp)` xhttp configured without tls, host configured with tls and **Fingerprint**. Node A configured to manage node B (Nodes settings) using token. Node A client, assigned with imported inbound from Node B, don't get tls/fingerprint setting in config. So outbound setting on Node A looks like ```json { "protocol": "vless", "tag": "proxy", "streamSettings": { "network": "xhttp", "security": "tls", "tlsSettings": {}, "xhttpSettings": { "host": "hostB.org", "mode": "packet-up", "path": "/xhttp/", "xPaddingBytes": "100-1000" } }, ``` But same outbound on Node B ```json { "protocol": "vless", "tag": "proxy", "streamSettings": { "network": "xhttp", "security": "tls", "tlsSettings": { "fingerprint": "firefox", "serverName": "hostB.org", "settings": { "fingerprint": "firefox" } }, "xhttpSettings": { "host": "hostB.org", "mode": "packet-up", "path": "/xhttp/", "xPaddingBytes": "100-1000" } } ``` ### How to reproduce the problem 1. Setup two nodes with xthhp (no tls) behind reverse proxy and provide fingerprint setting in host settings 2. Setup one node to manage another 3. Setup client on first node and assign second node inbound ### Expected behavior Client on first node get all related inbound settings from managed node, including fingerprint ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.4.2 ### Xray-core version v26.6.27 ### How did you install 3x-ui? Docker / Docker Compose ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Subscription (share links / Clash / JSON) ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:37:02 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Investigated against the current source (matches the reported 3.4.2 behavior). This is a real gap in the multi-node feature, not a configuration mistake on your end.

Title: Managed-node "Hosts" (the TLS/SNI/fingerprint subscription override) are never synced when a node's inbound is auto-adopted into the master's central database

Severity: Medium

Category: Correctness

Why this matters: the per-inbound "Host" override (Security/SNI/Fingerprint/ALPN/etc., internal/database/model/model.go:916-941) is looked up strictly by the local inbound_id in hostEndpoints() (internal/sub/host_sub.go:19-27). When your master (Node A) polls a managed node, runtime.Remote.FetchTrafficSnapshot (internal/web/runtime/remote.go:674-708) only calls panel/api/inbounds/list, clients/onlinesByGuid, clients/onlines and clients/lastOnline — there is no endpoint that returns the node's hosts table, and model.Inbound (internal/database/model/model.go:46-86) has no Hosts relation, so that payload cannot carry Host data even incidentally.

When the snapshot reports an inbound tag the master doesn't already have — i.e. Node A "adopting" an inbound that already existed on Node B, which is what Inbound sync: all/selected does per the multi-node docs — InboundService.setRemoteTrafficLocked creates the central copy with a plain tx.Create(&newIb) that copies Settings/StreamSettings verbatim (internal/web/service/inbound_node.go:505-527). It never writes to the hosts table, and it bypasses InboundService.AddInbound() entirely — which matters because AddInbound() is the only place that ever derives Host rows from an inbound's config (database.CreateHostsFromExternalProxy, internal/database/db.go:504-536, called at internal/web/service/inbound.go:821).

Net effect: the adopted inbound on Node A ends up with zero Host rows. SubJsonService.GetJson only applies a TLS/SNI/fingerprint override when hostEndpoints() returns entries (internal/sub/json_service.go:86-89); with none, getConfig falls back to a bare {"forceTls":"same", ...} synthetic entry (internal/sub/json_service.go:164-175) that never touches security/tlsSettings. The Host you configured for that inbound is simply not visible to the code generating the subscription on Node A.

On the exact "security":"tls","tlsSettings":{} shape in your example (rather than no tlsSettings at all): that's consistent with the fallback instead picking up a legacy streamSettings.externalProxy entry still embedded in the inbound's stored config — an older, superseded mechanism (frontend/src/schemas/protocols/stream/external-proxy.ts, internal/database/db.go:538-572) that predates the separate Hosts table. applyExternalProxyTLSToStream (internal/sub/service.go:1591-1611) always creates the tlsSettings object once forceTls is "tls", then fills serverName/fingerprint only if that entry actually carries them. I can't inspect your two panels' stored JSON, so treat this paragraph as a plausible explanation of the exact byte shape rather than confirmed fact; the core issue above (Host rows never sync between panels) is confirmed directly from the source.

Recommendation: extend the node polling/adoption path so a managed node's Host rows are fetched (e.g. a panel/api/hosts-style endpoint) and mirrored locally against the newly-created central inbound id inside setRemoteTrafficLocked, the same way client traffic/state already sync in that function. A narrower stop-gap would be to also run database.CreateHostsFromExternalProxy against snapIb.StreamSettings in the newIb branch, matching what AddInbound() already does for a manually-created/imported inbound — though that alone wouldn't help Hosts configured through the modern Hosts UI on the node, since those never touch streamSettings at all. A fix will only be made if requested by a maintainer (mention @claude); I have not made any code changes.

Example:

// internal/web/service/inbound_node.go, setRemoteTrafficLocked(), ~line 505
newIb := model.Inbound{
    ...
    StreamSettings: snapIb.StreamSettings, // node's raw config, no Host data
    ...
}
if err := tx.Create(&newIb).Error; err != nil { ... }
// no equivalent of database.CreateHostsFromExternalProxy(tx, newIb.Id, ...),
// and no fetch of the node's `hosts` table anywhere in this file or in
// runtime.Remote.FetchTrafficSnapshot (internal/web/runtime/remote.go:674-708)

Confidence: high that Host rows are never synced between panels (confirmed by checking every node-sync code path for model.Host references and finding none, plus model.Inbound having no Hosts relation). Medium confidence on the second paragraph's explanation of the specific empty-tlsSettings shape.

@MHSanaei for a decision on the fix approach.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4933164752 --> @github-actions[bot] commented on GitHub (Jul 10, 2026): Investigated against the current source (matches the reported 3.4.2 behavior). This is a real gap in the multi-node feature, not a configuration mistake on your end. **Title:** Managed-node "Hosts" (the TLS/SNI/fingerprint subscription override) are never synced when a node's inbound is auto-adopted into the master's central database **Severity:** Medium **Category:** Correctness **Why this matters:** the per-inbound "Host" override (Security/SNI/Fingerprint/ALPN/etc., `internal/database/model/model.go:916-941`) is looked up strictly by the *local* `inbound_id` in `hostEndpoints()` (`internal/sub/host_sub.go:19-27`). When your master (Node A) polls a managed node, `runtime.Remote.FetchTrafficSnapshot` (`internal/web/runtime/remote.go:674-708`) only calls `panel/api/inbounds/list`, `clients/onlinesByGuid`, `clients/onlines` and `clients/lastOnline` — there is no endpoint that returns the node's `hosts` table, and `model.Inbound` (`internal/database/model/model.go:46-86`) has no `Hosts` relation, so that payload cannot carry Host data even incidentally. When the snapshot reports an inbound tag the master doesn't already have — i.e. Node A "adopting" an inbound that already existed on Node B, which is what `Inbound sync: all/selected` does per the [multi-node docs](https://github.com/MHSanaei/3x-ui/blob/main/docs/content/docs/en/operations/multi-node.mdx) — `InboundService.setRemoteTrafficLocked` creates the central copy with a plain `tx.Create(&newIb)` that copies `Settings`/`StreamSettings` verbatim (`internal/web/service/inbound_node.go:505-527`). It never writes to the `hosts` table, and it bypasses `InboundService.AddInbound()` entirely — which matters because `AddInbound()` is the *only* place that ever derives `Host` rows from an inbound's config (`database.CreateHostsFromExternalProxy`, `internal/database/db.go:504-536`, called at `internal/web/service/inbound.go:821`). Net effect: the adopted inbound on Node A ends up with zero `Host` rows. `SubJsonService.GetJson` only applies a TLS/SNI/fingerprint override when `hostEndpoints()` returns entries (`internal/sub/json_service.go:86-89`); with none, `getConfig` falls back to a bare `{"forceTls":"same", ...}` synthetic entry (`internal/sub/json_service.go:164-175`) that never touches `security`/`tlsSettings`. The Host you configured for that inbound is simply not visible to the code generating the subscription on Node A. On the exact `"security":"tls","tlsSettings":{}` shape in your example (rather than no `tlsSettings` at all): that's consistent with the fallback instead picking up a legacy `streamSettings.externalProxy` entry still embedded in the inbound's stored config — an older, superseded mechanism (`frontend/src/schemas/protocols/stream/external-proxy.ts`, `internal/database/db.go:538-572`) that predates the separate Hosts table. `applyExternalProxyTLSToStream` (`internal/sub/service.go:1591-1611`) always creates the `tlsSettings` object once `forceTls` is `"tls"`, then fills `serverName`/`fingerprint` only if that entry actually carries them. I can't inspect your two panels' stored JSON, so treat this paragraph as a plausible explanation of the exact byte shape rather than confirmed fact; the core issue above (Host rows never sync between panels) is confirmed directly from the source. **Recommendation:** extend the node polling/adoption path so a managed node's `Host` rows are fetched (e.g. a `panel/api/hosts`-style endpoint) and mirrored locally against the newly-created central inbound id inside `setRemoteTrafficLocked`, the same way client traffic/state already sync in that function. A narrower stop-gap would be to also run `database.CreateHostsFromExternalProxy` against `snapIb.StreamSettings` in the `newIb` branch, matching what `AddInbound()` already does for a manually-created/imported inbound — though that alone wouldn't help Hosts configured through the modern Hosts UI on the node, since those never touch `streamSettings` at all. A fix will only be made if requested by a maintainer (mention @claude); I have not made any code changes. **Example:** ```go // internal/web/service/inbound_node.go, setRemoteTrafficLocked(), ~line 505 newIb := model.Inbound{ ... StreamSettings: snapIb.StreamSettings, // node's raw config, no Host data ... } if err := tx.Create(&newIb).Error; err != nil { ... } // no equivalent of database.CreateHostsFromExternalProxy(tx, newIb.Id, ...), // and no fetch of the node's `hosts` table anywhere in this file or in // runtime.Remote.FetchTrafficSnapshot (internal/web/runtime/remote.go:674-708) ``` Confidence: high that Host rows are never synced between panels (confirmed by checking every node-sync code path for `model.Host` references and finding none, plus `model.Inbound` having no `Hosts` relation). Medium confidence on the second paragraph's explanation of the specific empty-`tlsSettings` shape. @MHSanaei for a decision on the fix approach. *This reply was generated automatically; a maintainer may follow up.*
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#4083
No description provided.