diff options
author | 2017-01-15 08:12:58 +0000 | |
---|---|---|
committer | 2017-01-15 08:12:58 +0000 | |
commit | 52e01264e8a5901209f83335aa96e091c93ced7e (patch) | |
tree | 433625011d8ce8f041147ec4ef171d55678be2be /test/proxy_test.go | |
parent | a6d232a622a2f83a5d5ea1d9d946da7f910a0f9e (diff) | |
download | coredns-52e01264e8a5901209f83335aa96e091c93ced7e.tar.gz coredns-52e01264e8a5901209f83335aa96e091c93ced7e.tar.zst coredns-52e01264e8a5901209f83335aa96e091c93ced7e.zip |
middleware/proxy: implement Exchanger (#480)
By defining and using an proxy.Exchanger interface we make the proxy
more generic and we can then fold back httproxy into proxy.
This overrides #463 and #473 and should make futures extensions rather
trivial
* Add docs that talk about `protocol` and how to set it.
* middleware/proxy: rename New to NewLookup
It's used as a Lookup mechanism not as a completely new proxy,
reflect that in the name.
* Set maxfails to 3 by default when looking up names.
Most of the changes have been copied
from https://github.com/johnbelamaric/coredns/pull/1/files
Diffstat (limited to 'test/proxy_test.go')
-rw-r--r-- | test/proxy_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/proxy_test.go b/test/proxy_test.go index 01bfa0500..3f22a6cb9 100644 --- a/test/proxy_test.go +++ b/test/proxy_test.go @@ -38,7 +38,7 @@ func TestLookupProxy(t *testing.T) { log.SetOutput(ioutil.Discard) - p := proxy.New([]string{udp}) + p := proxy.NewLookup([]string{udp}) state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)} resp, err := p.Lookup(state, "example.org.", dns.TypeA) if err != nil { @@ -82,7 +82,7 @@ func BenchmarkLookupProxy(b *testing.B) { log.SetOutput(ioutil.Discard) - p := proxy.New([]string{udp}) + p := proxy.NewLookup([]string{udp}) state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)} b.ResetTimer() |