diff options
Diffstat (limited to 'att script/3 (v6 DDoS)/code/辅助权威服务器/plugin/whoami/setup.go')
| -rw-r--r-- | att script/3 (v6 DDoS)/code/辅助权威服务器/plugin/whoami/setup.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/att script/3 (v6 DDoS)/code/辅助权威服务器/plugin/whoami/setup.go b/att script/3 (v6 DDoS)/code/辅助权威服务器/plugin/whoami/setup.go new file mode 100644 index 0000000..9ab99bc --- /dev/null +++ b/att script/3 (v6 DDoS)/code/辅助权威服务器/plugin/whoami/setup.go @@ -0,0 +1,22 @@ +package whoami + +import ( + "github.com/coredns/caddy" + "ohmydns2/core/dnsserver" + "ohmydns2/plugin" +) + +func init() { plugin.Register("whoami", setup) } + +func setup(c *caddy.Controller) error { + c.Next() // 'whoami' + if c.NextArg() { + return plugin.Error("whoami", c.ArgErr()) + } + + dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler { + return Whoami{} + }) + + return nil +} |
