mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
Pr 586 tweaks (#594)
* add proxy tcp * add truncated for tcp to udp response * move truncation to scrubbing * add test that executes upstream over tcp * middleware/proxy: some tweaks rename force-tcp to force_tcp to be inline with the rest and use a dnsOptions struct to put the options in to allow it to be extended. Add some parse tests as well. * Fix test and rename dnsOptions Options
This commit is contained in:
@@ -14,6 +14,11 @@ import (
|
||||
|
||||
// NewLookup create a new proxy with the hosts in host and a Random policy.
|
||||
func NewLookup(hosts []string) Proxy {
|
||||
return NewLookupWithOption(hosts, Options{})
|
||||
}
|
||||
|
||||
// NewLookupWithForcedProto process creates a simple round robin forward with potentially forced proto for upstream.
|
||||
func NewLookupWithOption(hosts []string, opts Options) Proxy {
|
||||
p := Proxy{Next: nil}
|
||||
|
||||
upstream := &staticUpstream{
|
||||
@@ -23,7 +28,7 @@ func NewLookup(hosts []string) Proxy {
|
||||
Spray: nil,
|
||||
FailTimeout: 10 * time.Second,
|
||||
MaxFails: 3, // TODO(miek): disable error checking for simple lookups?
|
||||
ex: newDNSEx(),
|
||||
ex: newDNSExWithOption(opts),
|
||||
}
|
||||
|
||||
for i, host := range hosts {
|
||||
|
||||
Reference in New Issue
Block a user