bpipe
bpipe copied to clipboard
Investigate using WebRTC instead of client-server
It should be possible to eliminate the use of sending streams through the server by using WebRTC to establish a peer-to-peer connection.
Investigate this option and implement.
The functionality of streaming through a server should be preserved as a fallback API in case a WebRTC session can't be started.
I have performed a preliminary test of implementing WebRTC.
Switching to WebRTC communication is a relatively easy change to the code-base. The existing websocket server / client is ideal for acting as a signal server between peers.
The primary issue I ran across ( and blocked on ) was the fact that for node (itself) to peer via WebRTC ( such as peering a browser to a node, not just peering two browsers ) requires custom bindings and additional dependencies. see: https://github.com/js-platform/node-webrtc
Relying on additional deps and custom bindings are fragile and outweigh the immediate benefit of adding WebRTC to bpipe.
If anyone wants / needs WebRTC in the future I would agree to add it if the primary method of communication ( server-client websockets ) was preserved and used as a fallback should WebRTC not be available on the system.
:+1: