From a690dd2f9a8add58c7e7aaf6bf6ca1f04a8a7a2a Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 26 Dec 2022 13:56:00 -0500 Subject: [PATCH] if no dns then no go resolver nor override --- server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 5cc8bf2..b181398 100644 --- a/server.go +++ b/server.go @@ -28,12 +28,12 @@ func NewServer(c *Config) *Server { PreferGo: true, Dial: func(ctx context.Context, network, addr string) (net.Conn, error) { d := net.Dialer{Timeout: c.Timeout} - if c.DNS != "" { - addr = c.DNS - } - return d.DialContext(ctx, network, addr) + return d.DialContext(ctx, network, c.DNS) }, } + if c.DNS == "" { + resolver = &net.Resolver{} + } transport := &http.Transport{} transport.TLSClientConfig = &tls.Config{ InsecureSkipVerify: c.TLSInsecure,