if no dns then no go resolver nor override
parent
022e69f83c
commit
a690dd2f9a
|
|
@ -28,12 +28,12 @@ func NewServer(c *Config) *Server {
|
||||||
PreferGo: true,
|
PreferGo: true,
|
||||||
Dial: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
Dial: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
d := net.Dialer{Timeout: c.Timeout}
|
d := net.Dialer{Timeout: c.Timeout}
|
||||||
if c.DNS != "" {
|
return d.DialContext(ctx, network, c.DNS)
|
||||||
addr = c.DNS
|
|
||||||
}
|
|
||||||
return d.DialContext(ctx, network, addr)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if c.DNS == "" {
|
||||||
|
resolver = &net.Resolver{}
|
||||||
|
}
|
||||||
transport := &http.Transport{}
|
transport := &http.Transport{}
|
||||||
transport.TLSClientConfig = &tls.Config{
|
transport.TLSClientConfig = &tls.Config{
|
||||||
InsecureSkipVerify: c.TLSInsecure,
|
InsecureSkipVerify: c.TLSInsecure,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue