Skip to content

Add configurable host overrides for exported client links#3814

Open
MrTeeett wants to merge 2 commits intoMHSanaei:mainfrom
MrTeeett:feature/subscription-host-overrides
Open

Add configurable host overrides for exported client links#3814
MrTeeett wants to merge 2 commits intoMHSanaei:mainfrom
MrTeeett:feature/subscription-host-overrides

Conversation

@MrTeeett
Copy link

What is the pull request?

This pull request introduces configurable host overrides for exported client links and JSON subscriptions.

Previously, the exported client links derived the host from inbound.listen or the HTTP request host header. In setups using wildcard listen addresses (0.0.0.0 / ::), reverse proxies, CDNs, or NAT, this could result in incorrect or inconsistent host values in generated links.

This change adds a deterministic host resolution mechanism with the following priority:

  1. client.subHost (per-client override)
  2. inbound.settings.subHost (per-inbound override)
  3. Global default host (SubDefaultHost)
  4. inbound.listen (if not wildcard)
  5. Request host header (fallback)

All link generators (vmess, vless, trojan, shadowsocks) and JSON subscription exports now use this unified resolution logic.

The new field is optional and backward compatible.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Screenshots

изображение

@Ev3nt
Copy link

Ev3nt commented Feb 16, 2026

Useful feature. I'm glad someone developed it. 😁

@MHSanaei MHSanaei requested a review from alireza0 March 4, 2026 11:41
@MHSanaei MHSanaei force-pushed the main branch 2 times, most recently from 0dc4df2 to f0f98c7 Compare March 17, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants