plugin/forward: add prefer_udp option (#1944)

* plugin/forward: add prefer_udp option

* updated according to code review

 - fixed linter warning
 - removed metric parameter in Proxy.Connect()
This commit is contained in:
Ruslan Drozhdzh
2018-07-07 10:14:21 +03:00
committed by Miek Gieben
parent 7c41f2ce9f
commit bc50901234
8 changed files with 115 additions and 43 deletions

View File

@@ -187,7 +187,12 @@ func parseBlock(c *caddy.Controller, f *Forward) error {
if c.NextArg() {
return c.ArgErr()
}
f.forceTCP = true
f.opts.forceTCP = true
case "prefer_udp":
if c.NextArg() {
return c.ArgErr()
}
f.opts.preferUDP = true
case "tls":
args := c.RemainingArgs()
if len(args) > 3 {