feat(resolvers/HTTPS): add HTTP proxy support #119
2 changed files with 16 additions and 0 deletions
|
@ -4,6 +4,7 @@ package resolvers
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
@ -26,6 +27,17 @@ func (resolver *HTTPSResolver) LookUp(msg *dns.Msg) (util.Response, error) {
|
|||
|
||||
httpR := &http.Client{
|
||||
Timeout: resolver.opts.Request.Timeout,
|
||||
Transport: &http.Transport{
|
||||
MaxConnsPerHost: 1,
|
||||
MaxIdleConns: 1,
|
||||
MaxIdleConnsPerHost: 1,
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{
|
||||
//nolint:gosec // This is intentional if the user requests it
|
||||
InsecureSkipVerify: resolver.opts.TLSNoVerify,
|
||||
ServerName: resolver.opts.TLSHost,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
buf, err := msg.Pack()
|
||||
|
|
4
pkg/resolvers/docs.go
Normal file
4
pkg/resolvers/docs.go
Normal file
|
@ -0,0 +1,4 @@
|
|||
/*
|
||||
Package resolvers contain the various DNS resolvers to use.
|
||||
*/
|
||||
package resolvers
|
Loading…
Reference in a new issue