if no dns param then use whatever pipe chose

master
Bel LaPointe 2022-12-26 13:50:51 -05:00
parent 569d3f1d8e
commit 022e69f83c
1 changed files with 4 additions and 1 deletions

View File

@ -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{}