[GH-ISSUE #5569] [Feature]: new share address strategy (IP address) #3888

Open
opened 2026-10-31 20:35:40 +07:00 by bsakaguchi · 1 comment
Owner

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

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?

  • 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 @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? - [ ] 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.
Author
Owner

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

Three share-address strategies are currently implemented (confirmed in internal/sub/service.go at resolveInboundAddress() and in the frontend at frontend/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 Domain setting), 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 the Share Address field, with node address / listen address as fallbacks.

Interim workaround: The custom strategy already accepts an IPv4 or IPv6 address in the Share Address field. If you edit an inbound, set Share address strategy to Custom, 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 in resolveInboundAddress() (and the parallel resolveAddr() path in frontend/src/lib/xray/inbound-link.ts for panel-side share links) to perform the IP lookup, plus a new option in SHARE_ADDR_STRATEGIES in the form modal and the corresponding translation keys in internal/web/translation/.

The configuredPublicHost() function (lines 104–112 of internal/sub/service.go) returns GetSubDomain() or GetWebDomain() — 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 commits 2a7342ba and c47a905a.

If you would like to prototype a PR, the main touch points are:

  1. Add "ip" (or a similar name) to the ShareAddrStrategy enum/validation in internal/web/service/inbound.go and the SHARE_ADDR_STRATEGIES constant in the frontend form.
  2. Add a branch in resolveInboundAddress() that resolves the candidate address to its first A/AAAA record and returns that IP string.
  3. Mirror the same logic in resolveAddr() in frontend/src/lib/xray/inbound-link.ts (which handles panel-generated share links before a subscription request is made).
  4. Add translation keys for the new option in internal/web/translation/ for all 13 locale files.

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

<!-- gh-comment-id:4801477159 --> @github-actions[bot] commented on GitHub (Jun 25, 2026): Three share-address strategies are currently implemented (confirmed in `internal/sub/service.go` at `resolveInboundAddress()` and in the frontend at `frontend/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 Domain` setting), 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 the `Share Address` field, with node address / listen address as fallbacks. **Interim workaround:** The `custom` strategy already accepts an IPv4 or IPv6 address in the `Share Address` field. If you edit an inbound, set `Share address strategy` to `Custom`, 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 in `resolveInboundAddress()` (and the parallel `resolveAddr()` path in `frontend/src/lib/xray/inbound-link.ts` for panel-side share links) to perform the IP lookup, plus a new option in `SHARE_ADDR_STRATEGIES` in the form modal and the corresponding translation keys in `internal/web/translation/`. The `configuredPublicHost()` function (lines 104–112 of `internal/sub/service.go`) returns `GetSubDomain()` or `GetWebDomain()` — 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 commits `2a7342ba` and `c47a905a`. If you would like to prototype a PR, the main touch points are: 1. Add `"ip"` (or a similar name) to the `ShareAddrStrategy` enum/validation in `internal/web/service/inbound.go` and the `SHARE_ADDR_STRATEGIES` constant in the frontend form. 2. Add a branch in `resolveInboundAddress()` that resolves the candidate address to its first A/AAAA record and returns that IP string. 3. Mirror the same logic in `resolveAddr()` in `frontend/src/lib/xray/inbound-link.ts` (which handles panel-generated share links before a subscription request is made). 4. Add translation keys for the new option in `internal/web/translation/` for all 13 locale files. *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#3888
No description provided.