would be good to make the discovery be a module that can be replaced or used as a redundant plugin. That way the user can use DHT, WebTorrent, CloudFlare or whatever.
The library they are using does this. I wrote my own separate library that uses Cloudflare because it uses a bespoke protocol that takes advantage of some WebRTC hacks (SDP munging, DTLS certificate reuse, peer reflexive candidates, etc) to minimize I/O to R2 and hence reduce costs on Cloudflare.