Does js-libp2p WebRTC fallback to a relayed connection when direct connection failed? #2230
Replies: 1 comment 2 replies
-
At the moment there's no fallback as such. When dialling a WebRTC address if there's a relayed connection already open to the remote peer it'll remain open afterwards. If there's no relayed connection, a temporary one will be opened but it will be closed on WebRTC success or failure. An application could dial the circuit relay address explicitly if the WebRTC address fails, but the next problem it would encounter is that any long-lived or data-heavy protocols (gossipsub, bitswap, kad-dht, etc) will not run over relayed connections, only direct ones so the relayed connection isn't of much use. This is because relayed connections are data/duration limited and these protocols will trip the limits causing the connection to be killed by the relay unexpectedly. What use do you see for a fallback to the underlying relayed connection when dialling WebRTC? |
Beta Was this translation helpful? Give feedback.
-
The spec says:
Could confirm whether the fall back is implemented in
js-libp2p
and in the webrtc/browser-to-browser example?Beta Was this translation helpful? Give feedback.
All reactions