Re:PeerTube v6 is out, and powered by your ideas
by Sean-Der on Tuesday November 28, 2023 @04:28PM
(#38451556)
You have more choices then that for node.js
* https://github.com/shinyoshiaki/werift-webrtc
* https://github.com/murat-dogan/node-datachannel
If libwebrtc fits your needs you totally should use it! Alternatives have existed for years though
Given how complicated WebRTC is, I wouldn't put the blame on torrent clients either. libwebrtc by Google is the de-facto standard, and afaik you need to compile all of it (including video and audio codecs) even though WebTorrent only cares about data streams.
Even for Node.js, which should be an easy choice since webtorrent is written in JS, your choice is to either use wrtc (native addon that has to either be built from source or use a prebuilt binary - this is what webtorrent-hybrid uses - and this library hasn't seen an update in last 3 years) or electron (which bundles libwebrtc as part of Blink engine - afaik this is what webtorrent-desktop uses).
I wish there was a better web API for P2P traffic - sadly WebTransport is not meant for P2P use cases, i.e. doesn't punch firewalls etc. Then we could see some real improvements done to P2P ecosystem, instead of everyone wasting time on figuring out how to build, use and ship libwebrtc.