ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
15.82k stars 2.96k forks source link

Enable WebRTC Transport #9724

Open BigLep opened 1 year ago

BigLep commented 1 year ago

Done criteria

  1. libp2p's WebRTC transport is enabled by default.
  2. 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

  1. go-libp2p WebRTC transport (https://github.com/libp2p/go-libp2p/pull/2337 ) is merged and released.

Notes about the work involved

  1. Documenting the browser/Kubo communication story is covered https://github.com/ipfs/ipfs-docs/issues/1286
  2. Similar issues from when we did this for WebTransport:
  3. 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
BigLep commented 1 year ago

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.

SgtPooki commented 10 months ago

@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?

BigLep commented 10 months ago

@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)

marten-seemann commented 8 months ago

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.

BigLep commented 6 months ago

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

BigLep commented 5 months ago

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.

lidel commented 3 weeks ago

wip /webrtc-direct with /certhash: https://github.com/libp2p/go-libp2p/pull/2774