chore: add tls/ws to address factory

This commit is contained in:
Richard Ramos 2023-09-06 08:37:15 -04:00 committed by richΛrd
parent 8783cd2f45
commit be982d8617
1 changed files with 3 additions and 0 deletions

View File

@ -190,8 +190,11 @@ func WithDns4Domain(dns4Domain string) WakuNodeOption {
if params.enableWS || params.enableWSS {
if params.enableWSS {
// WSS is deprecated in https://github.com/multiformats/multiaddr/pull/109
wss, _ := multiaddr.NewMultiaddr(fmt.Sprintf("/tcp/%d/wss", params.wssPort))
addresses = append(addresses, hostAddrMA.Encapsulate(wss))
tlsws, _ := multiaddr.NewMultiaddr(fmt.Sprintf("/tcp/%d/tls/ws", params.wssPort))
addresses = append(addresses, hostAddrMA.Encapsulate(tlsws))
} else {
ws, _ := multiaddr.NewMultiaddr(fmt.Sprintf("/tcp/%d/ws", params.wsPort))
addresses = append(addresses, hostAddrMA.Encapsulate(ws))