http: allow specifying Go DNS resolver on config backends

This commit is contained in:
WeebDataHoarder
2025-04-27 13:05:11 +02:00
parent eb96acb559
commit 0473109e60
2 changed files with 13 additions and 2 deletions

View File

@@ -23,6 +23,10 @@ type Backend struct {
// IpHeader HTTP header to set containing the IP header. Set - to forcefully ignore global defaults.
IpHeader string `yaml:"ip-header"`
// GoDNS Resolve URL using the Go DNS server
// Only relevant when running with CGO enabled
GoDNS bool `yaml:"go-dns"`
}
func (b Backend) Create() (*httputil.ReverseProxy, error) {
@@ -30,7 +34,7 @@ func (b Backend) Create() (*httputil.ReverseProxy, error) {
b.IpHeader = ""
}
proxy, err := utils.MakeReverseProxy(b.URL)
proxy, err := utils.MakeReverseProxy(b.URL, b.GoDNS)
if err != nil {
return nil, err
}