feat(resolvers/HTTPS): add HTTP proxy support
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Sam Therapy 2022-09-27 21:03:32 +00:00
parent 14416d5aec
commit f22ca2f82f
2 changed files with 16 additions and 0 deletions

View file

@ -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
View file

@ -0,0 +1,4 @@
/*
Package resolvers contain the various DNS resolvers to use.
*/
package resolvers