[GH-ISSUE #5949] [Feature]: inbounds can set share port #4123

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

Originally created by @ClDaniel1 on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5949

my inbounds in forwarded via ng, subscription share is internal port, I need share prot 443

Describe the solution you'd like

inbounds can set share port

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @ClDaniel1 on GitHub (Jul 14, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5949 ### Is your feature request related to a problem? my inbounds in forwarded via ng, subscription share is internal port, I need share prot 443 ### Describe the solution you'd like inbounds can set share port ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:37:21 +07:00
Author
Owner

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

This is already supported by the Hosts feature, confirmed in the current codebase (Host struct in internal/database/model/model.go) and shipped in every release since v3.4.0, including the current latest (v3.5.0), via PR #5409.

Setup for your nginx setup:

  1. Open the panel sidebar → Hosts.
  2. Add a new host and select the inbound that's behind nginx.
  3. Leave Address blank to keep the inbound's current share address, and set Port to 443.
  4. Save.

Once a host exists for an inbound, every generated subscription link (raw, JSON, and Clash formats) for that inbound is built from the host's address/port instead of the inbound's own listening port. This is confirmed in internal/sub/host_sub.go (hostToExternalProxyMap, lines 50-53):

port := h.Port
if port == 0 {
    port = defaultPort
}

Leaving the host's port at 0 keeps the inbound's real port; setting it to 443 only changes what appears in the share link/subscription — Xray itself keeps listening on the actual internal port, nginx still forwards to it. You can add more than one host per inbound if you need multiple public endpoints/ports.

This is the same request as #5251 and #5247, both closed once this feature shipped.

Closing as already available. Please reopen or comment if your nginx setup still isn't covered by the Hosts form.

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

<!-- gh-comment-id:4965091383 --> @github-actions[bot] commented on GitHub (Jul 14, 2026): This is already supported by the **Hosts** feature, confirmed in the current codebase (`Host` struct in `internal/database/model/model.go`) and shipped in every release since `v3.4.0`, including the current latest (`v3.5.0`), via PR #5409. **Setup for your nginx setup:** 1. Open the panel sidebar → **Hosts**. 2. Add a new host and select the inbound that's behind nginx. 3. Leave **Address** blank to keep the inbound's current share address, and set **Port** to `443`. 4. Save. Once a host exists for an inbound, every generated subscription link (raw, JSON, and Clash formats) for that inbound is built from the host's address/port instead of the inbound's own listening port. This is confirmed in `internal/sub/host_sub.go` (`hostToExternalProxyMap`, lines 50-53): ```go port := h.Port if port == 0 { port = defaultPort } ``` Leaving the host's port at `0` keeps the inbound's real port; setting it to `443` only changes what appears in the share link/subscription — Xray itself keeps listening on the actual internal port, nginx still forwards to it. You can add more than one host per inbound if you need multiple public endpoints/ports. This is the same request as #5251 and #5247, both closed once this feature shipped. Closing as already available. Please reopen or comment if your nginx setup still isn't covered by the Hosts form. *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#4123
No description provided.