From 2ccef31f754d1dab6734a3a3e358b01333ec01e9 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Fri, 10 Mar 2023 17:00:39 +0800 Subject: [PATCH] fix: ensure wireguard inner use dialer with DefaultResolver --- adapter/outbound/wireguard.go | 1 + 1 file changed, 1 insertion(+) diff --git a/adapter/outbound/wireguard.go b/adapter/outbound/wireguard.go index 51c9ecb9..7eae30fc 100644 --- a/adapter/outbound/wireguard.go +++ b/adapter/outbound/wireguard.go @@ -221,6 +221,7 @@ func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, opts return nil, w.startErr } if !metadata.Resolved() { + options = append(options, dialer.WithResolver(resolver.DefaultResolver)) options = append(options, dialer.WithNetDialer(wgNetDialer{tunDevice: w.tunDevice})) conn, err = dialer.NewDialer(options...).DialContext(ctx, "tcp", metadata.RemoteAddress()) } else {