if no dns then no go resolver nor override

master
Bel LaPointe 2022-12-26 13:56:00 -05:00
parent 022e69f83c
commit a690dd2f9a
1 changed files with 4 additions and 4 deletions

View File

@ -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,