The protocol isn't coupled to the DOM or Electron in any way. The one thing that makes it easier to implement in electron is that it uses the WebRTC standard for peer to peer connections.
WebRTC is a beast of a protocol to implement, and so far browsers have had the canonical implementation. There's a few C++ libraries out there, but even then it's a lacking ecosystem.