bunch of other ipv6 fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2019-07-18 00:18:40 +03:00
parent 96cf14ed53
commit 1217ca94b1
7 changed files with 56 additions and 40 deletions

View File

@@ -627,12 +627,6 @@ func (h *httpBroker) Subscribe(topic string, handler Handler, opts ...SubscribeO
return nil, err
}
// ipv6 addr
if addr == "::" {
// ipv6 addr
addr = fmt.Sprintf("[%s]", addr)
}
// create unique id
id := h.id + "." + uuid.New().String()
@@ -645,7 +639,7 @@ func (h *httpBroker) Subscribe(topic string, handler Handler, opts ...SubscribeO
// register service
node := &registry.Node{
Id: id,
Address: fmt.Sprintf("%s:%s", addr, port),
Address: mnet.HostPort(addr, port),
Metadata: map[string]string{
"secure": fmt.Sprintf("%t", secure),
},