I'm building a decentralized ai marketplace and guess what? This piece of software is the backbone of our off-chain file transfer protocol. It just works; however, its seeder (BitTorrent-tracker) depends on node-webrtc, and it is not an official node package for web-rtc. It has some weird issues. For example, when you seed the torrent through BitTorrent-tracker, and on the client side (chrome browser), I used chrome://webrtc-internals to debug rtc connections. First time in my life, I coined the term connection leakage. A bug in the WebRTC handshake leads to too many connections (300+) for even 1kb torrents.
I hope it gets solved very soon.
I also attach my node profiling output. Looking for some advise if you have any..
I originally went the same route as you, and found that https://github.com/pion/webrtc is probably the best package out there for webrtc. I learned go just for it, and it paid off tenfold. Less memory, more connections, lower latency.
Same (I tried Node-based WebRTC packages), same (I found pion to be head and shoulders above everything else), same (I learned Go just so I could work with it).
Its ability to be simultaneously low-level and easy to work with is truly something else.
If you run your tracker on Linux and an info hash whitelist approach would work for your use case, it might be worthwhile to have a look at aquatic_ws [0]. It relies on tungstenite [1] for websockets and achieves around 20x the throughput of the reference implementation when running with four threads.
I don’t know of anybody who runs it in production, but its sister implementation (BitTorrent over UDP) handles 80k responses per second with lower load averages than opentorrent.
Lots of other great WebRTC implementations also exist. Check out https://github.com/sipsorcery/webrtc-echoes for all the other implementations if you are open to non node.js
hey, I'm one of the few remaining active WebTorrent devs and I've seen this issue myself, to the point where it's simply easier to use NWjs or Electron with node integration and use chromiums wrtc implementation instead of the wrtc package, if you ever manage to find a better replacement for wrtc for node tell me, and I'll make sure it's implemented ;p
I have this problem with WebRTC too. I'm operating from the native side with anacrolix/torrent and pion/webrtc. I wonder if it's not due to the JS implementation.
I hope it gets solved very soon.
I also attach my node profiling output. Looking for some advise if you have any..
[C++]:
[Summary]: [C++ entry points]: