[GH-ISSUE #5043] [Bug]: Exported link does not use the host domain configured in the inbound settings #3552

Closed
opened 2026-10-31 20:33:15 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Amy-yyh on GitHub (Jun 7, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5043

Describe the bug

I created a new inbound with VLESS + WebSocket + TLS. The host domain configured for this inbound is different from the panel domain.

However, when exporting the share link, the generated link uses the panel domain instead of the host domain configured in the inbound settings. The same incorrect panel domain is also used in the subscription update.

How to reproduce the problem

No response 

Expected behavior

No response 

Actual behavior

No response 

Relevant logs

No response

Screenshots

No response 

3x-ui version

3.2.8

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)

chrome

Is the panel behind a reverse proxy or CDN?

No — direct access

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 @Amy-yyh on GitHub (Jun 7, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5043 ### Describe the bug I created a new inbound with VLESS + WebSocket + TLS. The host domain configured for this inbound is different from the panel domain. However, when exporting the share link, the generated link uses the panel domain instead of the host domain configured in the inbound settings. The same incorrect panel domain is also used in the subscription update. ### How to reproduce the problem No response  ### Expected behavior No response  ### Actual behavior No response  ### Relevant logs ```shell No response ``` ### Screenshots No response  ### 3x-ui version 3.2.8 ### 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) chrome ### Is the panel behind a reverse proxy or CDN? No — direct access ### 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:33:15 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report!

What's happening

When 3x-ui generates a share link or subscription entry, the connection address is resolved in sub/subService.go (resolveInboundAddress()) using this priority:

  1. The node address, if the inbound is assigned to a multi-node entry
  2. The inbound's Listen field, if it is an explicit, publicly routable IP (not 0.0.0.0, not loopback, not a Unix socket)
  3. Otherwise, the host of the incoming request — i.e., the domain/IP you used to reach the panel

The WebSocket host header (streamSettings.wsSettings.host) and the TLS serverName / SNI are placed into the link only as URL parameters (?host=… and ?sni=…). They are not treated as the main connection address. So if your inbound listens on 0.0.0.0 and your panel domain differs from your CDN/proxy domain, the panel domain ends up in the link.

Workaround (available now): External Proxy

The panel has a dedicated field for exactly this case. In the inbound editor:

  1. Go to the Transport tab of your inbound.
  2. Enable the External Proxy toggle.
  3. Add one entry with:
    • Address (dest): your CDN/inbound-facing domain (e.g. cdn.example.com)
    • Port: the public port clients should connect to (e.g. 443)
    • Force TLS: set to tls if the CDN terminates TLS, or same to inherit the inbound's security
    • Optionally set a per-entry SNI if it differs from the address

With an External Proxy entry present, the link generator uses that dest/port instead of the panel domain, so the exported VLESS URL and subscription entries will advertise the correct address.

Longer-term

Issue #4891 is an open feature request for a more automatic solution — using the inbound's SNI or WS host value directly as the link address without needing a separate External Proxy entry. That request is labelled PR welcomed if you'd like to contribute.

Please try the External Proxy approach and let us know if it resolves the issue.

<!-- gh-comment-id:4641970642 --> @github-actions[bot] commented on GitHub (Jun 7, 2026): Thanks for the detailed report\! ## What's happening When 3x-ui generates a share link or subscription entry, the connection **address** is resolved in `sub/subService.go` (`resolveInboundAddress()`) using this priority: 1. The **node address**, if the inbound is assigned to a multi-node entry 2. The inbound's **Listen** field, if it is an explicit, publicly routable IP (not `0.0.0.0`, not loopback, not a Unix socket) 3. Otherwise, the **host of the incoming request** — i.e., the domain/IP you used to reach the panel The **WebSocket `host` header** (`streamSettings.wsSettings.host`) and the **TLS `serverName` / SNI** are placed into the link only as URL parameters (`?host=…` and `?sni=…`). They are not treated as the main connection address. So if your inbound listens on `0.0.0.0` and your panel domain differs from your CDN/proxy domain, the panel domain ends up in the link. ## Workaround (available now): External Proxy The panel has a dedicated field for exactly this case. In the inbound editor: 1. Go to the **Transport** tab of your inbound. 2. Enable the **External Proxy** toggle. 3. Add one entry with: - **Address (`dest`)**: your CDN/inbound-facing domain (e.g. `cdn.example.com`) - **Port**: the public port clients should connect to (e.g. `443`) - **Force TLS**: set to `tls` if the CDN terminates TLS, or `same` to inherit the inbound's security - Optionally set a per-entry **SNI** if it differs from the address With an External Proxy entry present, the link generator uses that `dest`/`port` instead of the panel domain, so the exported VLESS URL and subscription entries will advertise the correct address. ## Longer-term Issue #4891 is an open feature request for a more automatic solution — using the inbound's SNI or WS host value directly as the link address without needing a separate External Proxy entry. That request is labelled **PR welcomed** if you'd like to contribute. Please try the External Proxy approach and let us know if it resolves the issue.
Author
Owner

@Amy-yyh commented on GitHub (Jun 7, 2026):

Thank you for the explanation. I tried the External Proxy solution, and it fixed the issue. The exported link now uses the correct domain.

Thanks again for your help!

<!-- gh-comment-id:4642638460 --> @Amy-yyh commented on GitHub (Jun 7, 2026): Thank you for the explanation. I tried the External Proxy solution, and it fixed the issue. The exported link now uses the correct domain. Thanks again for your help!
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#3552
No description provided.