[GH-ISSUE #4888] [Bug]: 与#4798 类似的bug #3419

Closed
opened 2026-10-31 20:32:18 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @liolilin on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4888

Describe the bug

vps本机安装的3x-ui。版本号为3.2.7。使用方式为:主面板统一管理其他节点的入站线路,每个入站线路均在Address栏位强制写入该节点IP,但是当使用客户端二维码或订阅链接时,下载到手机APP中,未生成对应节点的IP,而是该节点的监听域名

How to reproduce the problem

1、create client
2、Attached others node inbounds
3、generate qr or copy link
4、open qr/link

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.7

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 24.04

Which parts of the panel are affected?

No response

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 @liolilin on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4888 ### Describe the bug vps本机安装的3x-ui。版本号为3.2.7。使用方式为:主面板统一管理其他节点的入站线路,每个入站线路均在Address栏位强制写入该节点IP,但是当使用客户端二维码或订阅链接时,下载到手机APP中,未生成对应节点的IP,而是该节点的监听域名 ### How to reproduce the problem 1、create client 2、Attached others node inbounds 3、generate qr or copy link 4、open qr/link ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.7 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 24.04 ### Which parts of the panel are affected? _No response_ ### 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:32:18 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

感谢反馈。经过代码分析,这是多节点模式下的一个设计问题,与 #4798 相关但原因不同。


根本原因

当一个入站绑定了某个节点(即 nodeId 不为空)时,订阅链接和二维码使用的是节点(Node)设置里的 Address 字段,而不是入站配置中的"监听地址(Address/Listen)"字段。

相关逻辑在后端 sub/subService.go 的 resolveInboundAddress 函数(第 727–736 行):

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   // ← 使用的是节点的 Address,不是入站的 Listen
        }
    }
    if listen := inbound.Listen; listen \!= "" && ... && isRoutableHost(listen) {
        return listen
    }
    return s.address
}

前端(frontend/src/lib/xray/inbound-link.ts,resolveAddr 函数)的逻辑与此一致:节点地址的优先级最高。


你遇到的情况

  • 入站配置里的"地址(Address)"字段 = 该节点的 IP(inbound.Listen)
  • 节点(Node)管理页面里的 Address = 你访问该节点面板所用的域名
  • 结果:订阅/二维码使用了节点的域名,而非入站里写的 IP

解决方法

前往节点管理页面(Node Settings),将对应节点的 Address 改为客户端应连接的 IP 地址(而不是域名)。

订阅系统使用的是 Node 实体的 Address,不是单个入站的监听地址。只要节点面板通过 IP 也能正常访问 API,这样修改后订阅链接就会输出正确的 IP。

注意: #4798 修复的是"无 NodeID 的普通入站"在订阅中不使用 Listen IP 的 bug(已在 3.2.7 修复)。多节点模式下始终优先使用节点的 Address,这一优先级在 #4798 的修复中被刻意保留下来。


若节点 API 只能通过域名访问

如果你的节点面板必须通过域名访问(无法用 IP 连接 API),但客户端订阅希望使用 IP,目前唯一可用的方式是在该入站上配置 External Proxy,用来单独指定客户端连接地址,不影响节点 API 的域名配置。


请确认节点管理里的 Address 是域名还是 IP,以及改成 IP 后节点状态是否仍然正常,这样可以帮助判断是配置问题还是需要进一步的代码改动。

<!-- gh-comment-id:4618268195 --> @github-actions[bot] commented on GitHub (Jun 4, 2026): 感谢反馈。经过代码分析,这是多节点模式下的一个设计问题,与 #4798 相关但原因不同。 --- ## 根本原因 当一个入站绑定了某个节点(即 `nodeId` 不为空)时,订阅链接和二维码使用的是**节点(Node)设置里的 `Address` 字段**,而不是入站配置中的"监听地址(Address/Listen)"字段。 相关逻辑在后端 `sub/subService.go` 的 `resolveInboundAddress` 函数(第 727–736 行): ```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 // ← 使用的是节点的 Address,不是入站的 Listen } } if listen := inbound.Listen; listen \!= "" && ... && isRoutableHost(listen) { return listen } return s.address } ``` 前端(`frontend/src/lib/xray/inbound-link.ts`,`resolveAddr` 函数)的逻辑与此一致:节点地址的优先级最高。 --- ## 你遇到的情况 - 入站配置里的"地址(Address)"字段 = 该节点的 IP(`inbound.Listen`) - **节点(Node)管理页面**里的 `Address` = 你访问该节点面板所用的**域名** - 结果:订阅/二维码使用了节点的域名,而非入站里写的 IP --- ## 解决方法 前往**节点管理页面**(Node Settings),将对应节点的 `Address` 改为客户端应连接的 **IP 地址**(而不是域名)。 订阅系统使用的是 Node 实体的 `Address`,不是单个入站的监听地址。只要节点面板通过 IP 也能正常访问 API,这样修改后订阅链接就会输出正确的 IP。 > **注意:** #4798 修复的是"无 NodeID 的普通入站"在订阅中不使用 Listen IP 的 bug(已在 3.2.7 修复)。多节点模式下始终优先使用节点的 `Address`,这一优先级在 #4798 的修复中被刻意保留下来。 --- ## 若节点 API 只能通过域名访问 如果你的节点面板必须通过域名访问(无法用 IP 连接 API),但客户端订阅希望使用 IP,目前唯一可用的方式是在该入站上配置 **External Proxy**,用来单独指定客户端连接地址,不影响节点 API 的域名配置。 --- 请确认节点管理里的 `Address` 是域名还是 IP,以及改成 IP 后节点状态是否仍然正常,这样可以帮助判断是配置问题还是需要进一步的代码改动。
Author
Owner

@liolilin commented on GitHub (Jun 4, 2026):

节点管理里的Address是域名,不是IP,该节点无法使用IP进行连接,但是客户端订阅希望使用 IP。
已在其他节点的入站配置中的“监听地址(Address/Listen)”字段设置为IP了

<!-- gh-comment-id:4618286410 --> @liolilin commented on GitHub (Jun 4, 2026): 节点管理里的Address是域名,不是IP,该节点无法使用IP进行连接,但是客户端订阅希望使用 IP。 已在其他节点的入站配置中的“监听地址(Address/Listen)”字段设置为IP了
Author
Owner

@MHSanaei commented on GitHub (Jun 4, 2026):

english please

<!-- gh-comment-id:4626558824 --> @MHSanaei commented on GitHub (Jun 4, 2026): english please
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#3419
No description provided.