From 022e69f83c5f77adf061176ca7c60cb0520e469f Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 26 Dec 2022 13:50:51 -0500 Subject: [PATCH] if no dns param then use whatever pipe chose --- server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 09f1df2..5cc8bf2 100644 --- a/server.go +++ b/server.go @@ -28,7 +28,10 @@ func NewServer(c *Config) *Server { PreferGo: true, Dial: func(ctx context.Context, network, addr string) (net.Conn, error) { d := net.Dialer{Timeout: c.Timeout} - return d.DialContext(ctx, network, c.DNS) + if c.DNS != "" { + addr = c.DNS + } + return d.DialContext(ctx, network, addr) }, } transport := &http.Transport{}