mirror of
https://github.com/go-micro/go-micro.git
synced 2026-06-15 19:35:13 +02:00
IPV6 too many colons in address net.SplitHostPort need ipv6 address in [host]:port format
This commit is contained in:
@@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -36,7 +37,7 @@ func serviceDef(opts server.Options) *registry.Service {
|
||||
|
||||
node := ®istry.Node{
|
||||
Id: opts.Name + "-" + opts.Id,
|
||||
Address: fmt.Sprintf("%s:%d", addr, port),
|
||||
Address: net.JoinHostPort(addr, fmt.Sprint(port)),
|
||||
Metadata: opts.Metadata,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user