[GH-ISSUE #5208] [Bug]: #3653

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

Originally created by @DS-83 on GitHub (Jun 11, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5208

Describe the bug

When a node is added with a VLESS TCP Reality inbound configured to listen on a specific IP address (not 0.0.0.0), the generated subscription contains an incorrect server address.

Instead of using the inbound's configured listening IP address, the subscription generator uses the panel domain name of the server where the node is installed.

As a result, clients receive an invalid connection configuration and cannot connect to the intended endpoint.

How to reproduce the problem

Deploy at least two 3x-ui servers.
On Server A, configure the panel domain (for example, panel-a.example.com).
Add Server B as a node to Server A.
On Server B, create a VLESS TCP Reality inbound.
Configure the inbound to listen on a specific IP address (for example, 185.xxx.xxx.xxx) instead of 0.0.0.0.
Generate or update a subscription from Server A.
Import the subscription into a client and inspect the generated VLESS Reality configuration for the node on Server B.

Expected behavior

The generated subscription should use the IP address configured in the inbound's Listen IP field as the server address.

Example:

Listen IP: 185.xxx.xxx.xxx

Generated address: 185.xxx.xxx.xxx

Actual behavior

The generated subscription ignores the configured Listen IP and instead uses the panel domain name.

Example:

Listen IP: 185.xxx.xxx.xxx

Panel domain: panel.example.com

Generated address: panel.example.com

This produces an incorrect client configuration when the inbound is intended to be reachable only through the specified IP address.

Relevant logs


Screenshots

No response

3x-ui version

3.3.0

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

AlmaLinux 10

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 @DS-83 on GitHub (Jun 11, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5208 ### Describe the bug When a node is added with a VLESS TCP Reality inbound configured to listen on a specific IP address (not 0.0.0.0), the generated subscription contains an incorrect server address. Instead of using the inbound's configured listening IP address, the subscription generator uses the panel domain name of the server where the node is installed. As a result, clients receive an invalid connection configuration and cannot connect to the intended endpoint. ### How to reproduce the problem Deploy at least two 3x-ui servers. On Server A, configure the panel domain (for example, panel-a.example.com). Add Server B as a node to Server A. On Server B, create a VLESS TCP Reality inbound. Configure the inbound to listen on a specific IP address (for example, 185.xxx.xxx.xxx) instead of 0.0.0.0. Generate or update a subscription from Server A. Import the subscription into a client and inspect the generated VLESS Reality configuration for the node on Server B. ### Expected behavior The generated subscription should use the IP address configured in the inbound's Listen IP field as the server address. Example: Listen IP: 185.xxx.xxx.xxx Generated address: 185.xxx.xxx.xxx ### Actual behavior The generated subscription ignores the configured Listen IP and instead uses the panel domain name. Example: Listen IP: 185.xxx.xxx.xxx Panel domain: panel.example.com Generated address: panel.example.com This produces an incorrect client configuration when the inbound is intended to be reachable only through the specified IP address. ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.0 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system AlmaLinux 10 ### 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:34:00 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 11, 2026):

The root cause is confirmed in the source. In internal/sub/service.go, resolveInboundAddress() (lines 800–810) applies this priority order when building subscription links:

  1. If the inbound has a NodeID set → return node.Address (the node's panel API host, e.g. panel-b.example.com)
  2. If inbound.Listen is a routable, non-unix-socket address → return that listen address
  3. Otherwise → fall back to the subscriber's request host
func (s *SubService) resolveInboundAddress(inbound *model.Inbound) string {
    if inbound.NodeID \!= nil && s.nodesByID \!= nil {
        if n, ok := s.nodesByID[*inbound.NodeID]; ok && n.Address \!= "" {
            return n.Address   // ← node panel address wins unconditionally
        }
    }
    if listen := inbound.Listen; listen \!= "" && listen[0] \!= '@' && listen[0] \!= '/' && isRoutableHost(listen) {
        return listen
    }
    return s.address
}

Because your inbound is node-managed (NodeID is set), step 1 returns the node's panel address and step 2 — which would return your explicit listen IP — is never reached. The same priority is mirrored in the frontend link builder (frontend/src/lib/xray/inbound-link.ts, resolveAddr()), so QR codes generated directly from the panel UI show the same incorrect host.

There is no per-inbound override field today. A feature request (#5161) is open that proposes adding a shareAddrStrategy field to Inbound so the user can choose between node address, listen address, or a custom value per inbound.

Workaround until that is implemented

Add an External Proxy entry to the inbound. When at least one External Proxy entry is present, resolveInboundAddress is bypassed for that inbound and ep["dest"] is used directly in the generated link.

  1. Open the inbound on the panel → Edit.
  2. On the Transport tab, scroll to External Proxy and add an entry:
    • Dest: 185.xxx.xxx.xxx (your intended listen IP)
    • Port: the inbound's listening port (e.g. 443)
    • Force TLS: same
    • Remark: optional
  3. Save and refresh the subscription.

The generated VLESS Reality link will now use the IP you specified in the External Proxy dest field instead of the node's panel address. The Reality and XTLS-Vision parameters (pbk, sid, sni, flow, etc.) are carried through from the inbound's stream settings unchanged.

This was previously reported in #4949 with identical root cause and the same workaround. The architectural fix is tracked in #5161.


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

<!-- gh-comment-id:4683530262 --> @github-actions[bot] commented on GitHub (Jun 11, 2026): The root cause is confirmed in the source. In `internal/sub/service.go`, `resolveInboundAddress()` (lines 800–810) applies this priority order when building subscription links: 1. If the inbound has a `NodeID` set → return `node.Address` (the node's panel API host, e.g. `panel-b.example.com`) 2. If `inbound.Listen` is a routable, non-unix-socket address → return that listen address 3. Otherwise → fall back to the subscriber's request host ```go func (s *SubService) resolveInboundAddress(inbound *model.Inbound) string { if inbound.NodeID \!= nil && s.nodesByID \!= nil { if n, ok := s.nodesByID[*inbound.NodeID]; ok && n.Address \!= "" { return n.Address // ← node panel address wins unconditionally } } if listen := inbound.Listen; listen \!= "" && listen[0] \!= '@' && listen[0] \!= '/' && isRoutableHost(listen) { return listen } return s.address } ``` Because your inbound is node-managed (`NodeID` is set), step 1 returns the node's panel address and step 2 — which would return your explicit listen IP — is never reached. The same priority is mirrored in the frontend link builder (`frontend/src/lib/xray/inbound-link.ts`, `resolveAddr()`), so QR codes generated directly from the panel UI show the same incorrect host. There is no per-inbound override field today. A feature request (#5161) is open that proposes adding a `shareAddrStrategy` field to `Inbound` so the user can choose between node address, listen address, or a custom value per inbound. **Workaround until that is implemented** Add an External Proxy entry to the inbound. When at least one External Proxy entry is present, `resolveInboundAddress` is bypassed for that inbound and `ep["dest"]` is used directly in the generated link. 1. Open the inbound on the panel → Edit. 2. On the **Transport** tab, scroll to **External Proxy** and add an entry: - **Dest**: `185.xxx.xxx.xxx` (your intended listen IP) - **Port**: the inbound's listening port (e.g. `443`) - **Force TLS**: `same` - **Remark**: optional 3. Save and refresh the subscription. The generated VLESS Reality link will now use the IP you specified in the External Proxy dest field instead of the node's panel address. The Reality and XTLS-Vision parameters (`pbk`, `sid`, `sni`, `flow`, etc.) are carried through from the inbound's stream settings unchanged. This was previously reported in #4949 with identical root cause and the same workaround. The architectural fix is tracked in #5161. --- *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#3653
No description provided.