Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-01-12 16:06:06 +01:00
parent 822e45ebb5
commit 722133881b
9 changed files with 69 additions and 43 deletions

View File

@@ -21,8 +21,14 @@ func setup(c *caddy.Controller) error {
return plugin.Error("traffic", err)
}
t, err := New()
if err != nil {
return plugin.Error("traffic", err)
}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
return &Traffic{Next: next, assignments: make(map[string]assignment)}
t.Next = next
return t
})
return nil