Fix ipv6 address advertisement

This commit is contained in:
Wim 2015-12-22 21:40:36 +01:00
parent 49d2793acc
commit e8e492f574
1 changed files with 5 additions and 0 deletions

View File

@ -354,6 +354,11 @@ func (c *ServerCommand) detectAdvertise(detect physical.AdvertiseDetect,
return "", err
}
// set [] for ipv6 addresses
if strings.Contains(host, ":") && !strings.Contains(host, "]") {
host = "[" + host + "]"
}
// Default the port and scheme
scheme := "https"
port := 8200