Enable WebRTC Transport
Done criteria
- libp2p's WebRTC transport is enabled by default.
- There are corresponding docs that describe how/why to use this.
Background
WebRTC provides another way for browsers to connect with the rest of the libp2p network (beyond WebTransport which is Chromium only at least as of 2023-03-14). We want to enable browser nodes to be able to communicate easily with other nodes in the network. To accomplish this we need a good amount of nodes in the network to have webtransport/webrtc listen addresses. Getting Kubo nodes having WebTransport listening by default is a good way to increase the number of nodes that browser nodes can connect to.
Preconditions
- go-libp2p WebRTC transport (https://github.com/libp2p/go-libp2p/pull/2337 ) is merged and released.
Notes about the work involved
- [ ] Changelog entry
- [ ] Config update (similar to WebTransport in https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmtransportsnetworkwebtransport )
- Documenting the browser/Kubo communication story is covered https://github.com/ipfs/ipfs-docs/issues/1286
- Similar issues from when we did this for WebTransport:
- https://github.com/ipfs/kubo/pull/9293
- https://github.com/ipfs/kubo/issues/9292
- https://github.com/ipfs/kubo/pull/9314
- With WebTransport we first had this as experimental. This may change, but my current proposal is that we enable it by default from the start
I expect this will land in Kubo 0.21 (not 0.20) given Kubo maintainers are busy preparing for IPFS Thing and WebRTC hasn't shipped in go-libp2p yet.
@lidel It seems like this didn't land in 0.21, and was moved to blocked. Can we get a list of the next action items and ETA?
@SgtPooki : unfortunately we don't have WebRTC in go-libp2p yet. Here is the new PR: https://github.com/libp2p/go-libp2p/pull/2337 . I have updated the "Preconditions" above. I believe go-libp2p is targeting mid-July, so I would expect this makes it into Kubo for 0.23 (end of August/early September)
We're planing to ship experimental WebRTC support in go-libp2p v0.31. "Experimental" here means that to the best of our knowledge, the spec is implemented correctly, which means that it's possible to establish WebRTC connections and transfer. However, we make no guarantees regarding performance and resilience against resource exhaustion attacks.
Therefore, WebRTC should not be enabled by default at this point. Instead we should follow the rollout plan we used for the QUIC transport a couple of years ago, meaning that there should be a config flag to enable the WebRTC transport. In order to enable the WebRTC transport on the server side, nodes will also need to configure a WebRTC swarm listen address.
Kubo 0.25 conversation: there will be work here if there is a new go-libp2p that has webrtc-direct that is non-experimental and/or if there is the webrtc (private-to-private) support
2023-11-30 conversation: given the conditions in https://github.com/ipfs/kubo/issues/9724#issuecomment-1804141957 haven't happened, there is no work for 0.25 on this. This is blocked until https://github.com/libp2p/go-libp2p/issues/2656 is addressed.
wip /webrtc-direct with /certhash: https://github.com/libp2p/go-libp2p/pull/2774