pub fn multiaddr_to_ws_url(addr: &str) -> Result<String, String>Expand description
Normalize a peer address to a WebSocket URL the relay can dial.
Accepts:
- a libp2p multiaddr:
/ip4/H/tcp/P,/ip6/H/tcp/P,/dns4/H/tcp/P(also/dns,/dns6,/dnsaddr), with an optional/wsor/wsstransport suffix (defaultws) and an optional trailing/p2p/<id>(ignored — the relay addresses by host:port, not peer id); - a raw
ws://…orwss://…URL, returned unchanged.
IPv6 literals are bracketed (/ip6/::1/tcp/9944 → ws://[::1]:9944).
Returns Err with a human message on anything it cannot map.