Add _grpc_config replies

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-03-30 09:09:34 +02:00
parent 36dec4ca85
commit e2238cfad8
5 changed files with 33 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package traffic
import (
"crypto/tls"
"encoding/json"
"fmt"
"math/rand"
"strings"
@@ -31,6 +32,9 @@ func setup(c *caddy.Controller) error {
if err != nil {
return plugin.Error("traffic", err)
}
if _, err := json.Marshal(lbTXT); err != nil {
return fmt.Errorf("failed to marshal grpc serverConfig: %s", err)
}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
t.Next = next