mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6007] [Bug]: wireguard host problem #4161
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#4161
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 @vercel9500 on GitHub (Jul 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6007
Describe the bug
When we configure an inbound WireGuard interface on the host, it doesn't get applied correctly in the panel.
In the Clients section:
If the client imports the configuration using the subscription link, the subscription URL's domain is used as the WireGuard endpoint.
If the configuration is added manually, the panel's domain/address is used as the WireGuard endpoint instead.
This behavior is incorrect because the configured inbound WireGuard host/address is ignored in both cases.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
v3.5.0
Xray-core version
26.7.11
How did you install 3x-ui?
install.sh script
Operating system
ubuntu 24
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No response
Before submitting
@github-actions[bot] commented on GitHub (Jul 16, 2026):
There is no separate "WireGuard host" field per inbound. Confirmed in
frontend/src/schemas/protocols/inbound/wireguard.ts:WireguardInboundSettingsSchemaonly hasmtu,secretKey,dns,peers,clients,noKernelTun,domainStrategy— nohost/endpointfield. The endpoint written into client configs comes from the inbound's general Share address strategy, the same mechanism used for VLESS/VMess/Trojan/etc. share links.The endpoint host is resolved with this priority (confirmed in
internal/sub/service.goresolveInboundAddress, mirrored on the panel side infrontend/src/lib/xray/inbound-link.tsresolveShareHost):listencolumn) — only if it holds a real, routable host (not blank, not0.0.0.0, not loopback, not a unix-socket path),Custom,PrepareForRequest/s.addressininternal/sub/service.go), while the panel's own Clients/QR pages (frontend/src/pages/clients/wireguardConfig.ts,frontend/src/pages/inbounds/qr/QrCodeModal.tsx) use the browser's current hostname (or the configured Sub/Web domain if reached vialocalhost).That matches exactly what's described: with Share address strategy left on its default (
Node address) and no routable value in Address, both flows fall through to step 4 and pick the two different fallback hosts — the sub domain for subscription imports, the panel's own host for manual/QR — instead of a WireGuard-specific host.Fix: open the inbound (Edit), Basics tab, set Share address strategy to
Custom, and put the real host/IP in Custom share address (no scheme or port). I traced both consumers —internal/sub/service.go(genWireguardLink) and the panel side (frontend/src/pages/clients/wireguardConfig.ts/QrCodeModal.tsx, both viaresolveShareHost) — and they read the sameshareAddr/shareAddrStrategycolumns, so a value set there is honored identically by both. If the WireGuard inbound genuinely listens on a specific public IP/domain in Address,Inbound listenworks instead.I did not find a code path where a correctly-set
CustomorInbound listenstrategy gets overridden for WireGuard specifically, so before this can be confirmed as a defect rather than a configuration/discoverability gap, it would help to have:Endpoint =value actually produced vs. the host expected.@MHSanaei for visibility regardless: Share address strategy lives in the generic Basics tab, not the WireGuard-specific settings, so it doesn't read as "the WireGuard endpoint setting" — even if no code defect turns up here, this may be worth a UI hint or docs note scoped to WireGuard inbounds.
This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 23, 2026):
The WireGuard endpoint is configurable via the inbound's Share Address Strategy (set it to Custom or Listen); the default 'node' strategy intentionally uses the subscription/panel host. Closing.