extract an ip that can be advertised in embedded nats
This commit is contained in:
parent
058fd8adbf
commit
bdf1d20f4e
@ -120,7 +120,13 @@ func (n *natsBroker) serve(exit chan bool) error {
|
|||||||
// with no address we just default it
|
// with no address we just default it
|
||||||
// this is a local client address
|
// this is a local client address
|
||||||
if len(n.addrs) == 0 {
|
if len(n.addrs) == 0 {
|
||||||
host = "127.0.0.1"
|
// find an advertiseable ip
|
||||||
|
if h, err := addr.Extract(""); err != nil {
|
||||||
|
host = "127.0.0.1"
|
||||||
|
} else {
|
||||||
|
host = h
|
||||||
|
}
|
||||||
|
|
||||||
port = -1
|
port = -1
|
||||||
local = true
|
local = true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user