top | item 33791766

(no title)

dmotz | 3 years ago

WebTorrent is obviously well suited for p2p file distribution, but using a minimal subset of the protocol also provides a nice hack for easily bootstrapping peer connections between web app users. Piggybacking on public mediums already designed to do peer exchange can let you rapidly prototype a WebRTC project without the hassle of running your own server anywhere.

I built a library that explores this idea: https://github.com/dmotz/trystero

And here's how it talks to WebTorrent servers to bootstrap peer connections: https://github.com/dmotz/trystero/blob/main/src/torrent.js

It also allows encrypting your peers' session descriptions to hide them from the torrent server. All of this is of course experimental and I'm very open to feedback.

discuss

order

jckahn|3 years ago

Thank you so much for your work on Trystero! It’s one of the most amazing projects I’ve ever found. I’ve used it to great success on multiple projects and I’m a big fan. I don’t understand how Trystero doesn’t have thousands of GitHub stars by now.

I wish more people would pay attention to Trystero because it enables so many interesting use cases. It’s the foundation of https://chitchatter.im/ and I recently wrote about the potential of this library: https://dev.to/jeremyckahn/taking-the-power-back-with-web-me...