fix: advertise addr IP

This commit is contained in:
Richard Ramos 2022-07-26 11:24:24 -04:00
parent 60c359fe5e
commit ecf55b6f89
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C
1 changed files with 8 additions and 2 deletions

View File

@ -184,10 +184,16 @@ func WithAdvertiseAddress(address *net.TCPAddr) WakuNodeOption {
result = append(result, advertiseAddress)
if params.enableWS || params.enableWSS {
if params.enableWSS {
wsMa, _ := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d/wss", address, params.wssPort))
wsMa, err := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d/wss", address.IP, params.wssPort))
if err != nil {
panic(err)
}
result = append(result, wsMa)
} else {
wsMa, _ := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d/ws", address, params.wsPort))
wsMa, err := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d/ws", address.IP, params.wsPort))
if err != nil {
panic(err)
}
result = append(result, wsMa)
}
}