diff options
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r-- | plugin/forward/setup.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go index 8070369c9..b5eeab912 100644 --- a/plugin/forward/setup.go +++ b/plugin/forward/setup.go @@ -99,8 +99,13 @@ func parseStanza(c *caddy.Controller) (*Forward, error) { } transports := make([]string, len(toHosts)) + allowedTrans := map[string]bool{"dns": true, "tls": true} for i, host := range toHosts { trans, h := parse.Transport(host) + + if !allowedTrans[trans] { + return f, fmt.Errorf("'%s' is not supported as a destination protocol in forward: %s", trans, host) + } p := NewProxy(h, trans) f.proxies = append(f.proxies, p) transports[i] = trans |