1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-07-12 22:41:07 +02:00
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

View File

@ -13,6 +13,7 @@ import (
"sync"
"time"
proto "github.com/asim/go-micro/plugins/broker/grpc/v4/proto"
"github.com/google/uuid"
"go-micro.dev/v4/broker"
"go-micro.dev/v4/cmd"
@ -23,7 +24,6 @@ import (
maddr "go-micro.dev/v4/util/addr"
mnet "go-micro.dev/v4/util/net"
mls "go-micro.dev/v4/util/tls"
proto "github.com/asim/go-micro/plugins/broker/grpc/v4/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
@ -505,7 +505,7 @@ func (h *grpcBroker) Subscribe(topic string, handler broker.Handler, opts ...bro
// register service
node := &registry.Node{
Id: id,
Address: fmt.Sprintf("%s:%d", addr, port),
Address: net.JoinHostPort(addr, fmt.Sprint(port)),
Metadata: map[string]string{
"secure": fmt.Sprintf("%t", secure),
},