From a308ded2e692a38fa2d01c3009bf11ac37e4a62b Mon Sep 17 00:00:00 2001 From: LjhAUMEM Date: Thu, 24 Sep 2026 09:59:28 +0800 Subject: [PATCH] WireGuard outbound: Fix endpoint IP address (#6804) Fixes https://github.com/XTLS/Xray-core/issues/6803 --- proxy/wireguard/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/wireguard/client.go b/proxy/wireguard/client.go index 4b4811f28..2836ab586 100644 --- a/proxy/wireguard/client.go +++ b/proxy/wireguard/client.go @@ -336,6 +336,9 @@ func (h *Handler) init(ctx context.Context) error { } func (h *Handler) resolveLocal(host string) (net.IP, error) { + if ip := net.ParseIP(host); ip != nil { + return ip, nil + } ips, _, err := h.dns.LookupIP(host, dns.IPOption{IPv4Enable: true, IPv6Enable: true}) if err != nil { return nil, err