IPV6 too many colons in address
net.SplitHostPort need ipv6 address in [host]:port format
This commit is contained in:
Johnson C
2021-10-28 17:03:48 +08:00
committed by GitHub
parent e155029a4b
commit ed690ed838
7 changed files with 17 additions and 16 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package http
import (
"fmt"
"net"
"reflect"
"strconv"
"strings"
@@ -36,7 +37,7 @@ func serviceDef(opts server.Options) *registry.Service {
node := &registry.Node{
Id: opts.Name + "-" + opts.Id,
Address: fmt.Sprintf("%s:%d", addr, port),
Address: net.JoinHostPort(addr, fmt.Sprint(port)),
Metadata: opts.Metadata,
}