mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5569] [Feature]: new share address strategy (IP address) #3888
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3888
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @forwork10 on GitHub (Jun 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5569
Is your feature request related to a problem?
Currently, the Inbound Listen and Node Address strategies are available, but if the panel has a TLS certificate configured, the domain will be displayed instead of the IP address. When a client receives a subscription, the address field contains the domain, and upon the first connection, the domain name must first be resolved, which can take a long time. For example, if all outbound connections are controlled by an observatory, the observatory check may not work correctly, since DNS resolve time is also factored into the ping.
Describe the solution you'd like
I would like to see new strategies that will set the IP address of the panel instead of the domain in the config
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?
Subscription (share links / Clash / JSON)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 25, 2026):
Three share-address strategies are currently implemented (confirmed in
internal/sub/service.goatresolveInboundAddress()and in the frontend atfrontend/src/pages/inbounds/form/InboundFormModal.tsx):node(default) — uses the node's configured address, then falls back to the inbound listen address, then the panel's configured public domain (Sub Domain/Web Domainsetting), then the request host.listen— uses the inbound listen address first, then node address, then panel domain.custom— uses an explicit value you type in theShare Addressfield, with node address / listen address as fallbacks.Interim workaround: The
customstrategy already accepts an IPv4 or IPv6 address in theShare Addressfield. If you edit an inbound, setShare address strategytoCustom, and enter your server's IP, all subscription output (raw, JSON, Clash) will use that IP address rather than the TLS domain. IPv6 addresses must be entered with brackets, e.g.[2001:db8::1]. This requires manual entry per inbound and does not update automatically if the IP changes.What this feature request adds: An automatic strategy — call it
"ip"or"panel-ip"— that the panel resolves at request time from its own network interface or by resolving the configured domain, without requiring manual per-inbound configuration. That would require new logic inresolveInboundAddress()(and the parallelresolveAddr()path infrontend/src/lib/xray/inbound-link.tsfor panel-side share links) to perform the IP lookup, plus a new option inSHARE_ADDR_STRATEGIESin the form modal and the corresponding translation keys ininternal/web/translation/.The
configuredPublicHost()function (lines 104–112 ofinternal/sub/service.go) returnsGetSubDomain()orGetWebDomain()— both of which are domain strings when TLS is configured — and there is currently no code path that resolves those to an IP before embedding them in links. The enhancement is valid and distinct from what was shipped in commits2a7342baandc47a905a.If you would like to prototype a PR, the main touch points are:
"ip"(or a similar name) to theShareAddrStrategyenum/validation ininternal/web/service/inbound.goand theSHARE_ADDR_STRATEGIESconstant in the frontend form.resolveInboundAddress()that resolves the candidate address to its first A/AAAA record and returns that IP string.resolveAddr()infrontend/src/lib/xray/inbound-link.ts(which handles panel-generated share links before a subscription request is made).internal/web/translation/for all 13 locale files.This reply was generated automatically; a maintainer may follow up.