Bug Fixes
- It was not possible to use IPv6 addresses - Some times, Ocean chose the address fe80::1
This commit is contained in:
1 parent
5def8d0785
commit
093a3988c0
2 files changed
+10
-2
No files matched your search
@@ -27,7 +27,7 @@ func initIPAddresses4ThisHost() {
|
||||
}
|
||||
|
||||
ip := net.ParseIP(addressText)
|
||||
if !ip.IsLoopback() && !ip.IsUnspecified() {
|
||||
if !ip.IsLoopback() && !ip.IsUnspecified() && strings.ToLower(ip.String()) != `fe80::1` {
|
||||
ipAddresses[counter] = ip.String()
|
||||
counter++
|
||||
}
|
||||
|
||||
+9
-1
@@ -1,11 +1,13 @@
|
||||
package Tools
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/SommerEngineering/Ocean/ConfigurationDB"
|
||||
"github.com/SommerEngineering/Ocean/Log"
|
||||
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -30,7 +32,13 @@ func init() {
|
||||
// Build the local IP address and port:
|
||||
allHostsIPAddresses := ReadAllIPAddresses4ThisHost()
|
||||
port := ConfigurationDB.Read(`PublicWebServerPort`)
|
||||
localIPAddressAndPort = allHostsIPAddresses[0] + `:` + port
|
||||
if strings.Contains(allHostsIPAddresses[0], `:`) {
|
||||
// Case: IPv6
|
||||
localIPAddressAndPort = fmt.Sprintf("[%s]:%s", allHostsIPAddresses[0], port)
|
||||
} else {
|
||||
// Case: IPv4
|
||||
localIPAddressAndPort = fmt.Sprintf("%s:%s", allHostsIPAddresses[0], port)
|
||||
}
|
||||
|
||||
// Read the default language:
|
||||
defaultLanguage = ConfigurationDB.Read(`DefaultLanguageCode`)
|
||||
|
||||
Reference in new issue
Block a user