[GH-ISSUE #6647] [Feature]: Use Hosts for AmneziaWG (and WireGuard/TUIC) client configs, like #6369 did for MTProto #4442

Open
opened 2026-10-31 20:39:41 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @voron08-ops on GitHub (Sep 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6647

Version: 3x-ui v3.8.5 (Docker)

Current behaviour

With a Host entry defined for an AmneziaWG inbound, share links built by the backend use it (sub/service.go: hostEndpoints -> linkFromHosts), but the "AmneziaWG config" shown in the client QR/info dialog does not. It is built in the browser (ClientQrModal.tsx -> buildAmneziaWGClientConfig) from resolveShareHost(inbound, nodeAddress, preferPublicHost(window.location.hostname, subSettings.publicHost)), so without a share-address strategy and without a Sub/Web domain the Endpoint is the browser hostname. For a panel reached through an SSH tunnel that is 127.0.0.1.

I understand from #6007 that this is intended and that Share Address Strategy (Custom/Listen) is the way to set the endpoint. The request is about consistency: the same inbound currently has two places that define its public address (Hosts and Share Address Strategy), and which one applies depends on the protocol and on whether the output is a link or a config file.

Request

Apply the inbound's Host entry (address and port) to the AmneziaWG client config as well, the same way #6369 moved MTProto share links to Hosts. By reading the code, WireGuard and TUIC configs appear to go through the same browser-side path (not tested on my side), so they would likely benefit too.

Why it matters

Hosts is the place people already set the public address for share links; a config that silently falls back to 127.0.0.1 is easy to hand out broken, and there is no hint in the UI that Hosts is not applied to it.

Originally created by @voron08-ops on GitHub (Sep 24, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6647 Version: 3x-ui v3.8.5 (Docker) **Current behaviour** With a Host entry defined for an AmneziaWG inbound, share links built by the backend use it (`sub/service.go`: `hostEndpoints` -> `linkFromHosts`), but the "AmneziaWG config" shown in the client QR/info dialog does not. It is built in the browser (`ClientQrModal.tsx` -> `buildAmneziaWGClientConfig`) from `resolveShareHost(inbound, nodeAddress, preferPublicHost(window.location.hostname, subSettings.publicHost))`, so without a share-address strategy and without a Sub/Web domain the Endpoint is the browser hostname. For a panel reached through an SSH tunnel that is `127.0.0.1`. I understand from #6007 that this is intended and that Share Address Strategy (Custom/Listen) is the way to set the endpoint. The request is about consistency: the same inbound currently has two places that define its public address (Hosts and Share Address Strategy), and which one applies depends on the protocol and on whether the output is a link or a config file. **Request** Apply the inbound's Host entry (address and port) to the AmneziaWG client config as well, the same way #6369 moved MTProto share links to Hosts. By reading the code, WireGuard and TUIC configs appear to go through the same browser-side path (not tested on my side), so they would likely benefit too. **Why it matters** Hosts is the place people already set the public address for share links; a config that silently falls back to `127.0.0.1` is easy to hand out broken, and there is no hint in the UI that Hosts is not applied to it.
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#4442
No description provided.