reverseproxy: add support for custom DNS resolver (#3479)
* reverse proxy: add support for custom resolver
* reverse proxy: don't pollute the global resolver with bootstrap resolver setup
* Improve documentation of reverseproxy.UpstreamResolver fields
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* reverse proxy: clarify the name resolution conventions of upstream resolvers and bootstrap resolver
* remove support for bootstraper of resolver
* godoc and code-style changes
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
// UpstreamResolver holds the set of addresses of DNS resolvers of
// upstream addresses
typeUpstreamResolverstruct{
// The addresses of DNS resolvers to use when looking up the addresses of proxy upstreams.
// It accepts [network addresses](/docs/conventions#network-addresses)
// with port range of only 1. If the host is an IP address, it will be dialed directly to resolve the upstream server.
// If the host is not an IP address, the addresses are resolved using the [name resolution convention](https://golang.org/pkg/net/#hdr-Name_Resolution) of the Go standard library.
// If the array contains more than 1 resolver address, one is chosen at random.
Addresses[]string`json:"addresses,omitempty"`
netAddrs[]caddy.NetworkAddress
}
// KeepAlive holds configuration pertaining to HTTP Keep-Alive.
typeKeepAlivestruct{
// Whether HTTP Keep-Alive is enabled. Default: true