feat(resolvers/HTTPS): add HTTP proxy support #119

Merged
sam merged 2 commits from http-proxy-support into master 2022-09-28 18:08:56 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit f22ca2f82f - Show all commits

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