4 ms·
I am working on an open source framework which connects nodes for collaboration and p2p transfer. I started off with WebRTC at the core but have since made it o
by elwebmaster 6y ago
I am working on an open source framework which connects nodes for collaboration and p2p transfer. I started off with WebRTC at the core but have since made it optional transport due to lack of portability. Snapdrop is amazing but if you give up on WebRTC you can use QR code for discovery and transfer files even when not on the same network.
- kekub 6y agoDo you have any more information on that? Is there already a repo or something I can follow?
- subins2000 6y agoWebRTC connection requires the peers to exchange signal data. This can be through a middleman server, Qr code or even pen & paper. I've made a library that uses WebTorrent trackers to exchange the signal data and make P2P connections : https://github.com/subins2000/p2pt https://github.com/subins2000/p2pt
- elwebmaster 6y agoSignalling through QR code or pen & paper while possible in theory is not feasible in practice because both sides need to exchange ICE candidates & offer/answer. So a signalling middleman, whether through websockets, SSE, polling, etc. is needed. And if you want to support network handoff then you need persistent connection to the signalling server for re-negotiation.
- elwebmaster 6y agoYes, the first version is here: https://github.com/uhst/uhst-client-js https://github.com/uhst/uhst-client-js and there is a demo Ping app: https://examples.run/ping/ https://examples.run/ping/ . Originally my idea was to use SSE for signalling but in version 2 it becomes a relay between peers. This approach will make it portable to mobile (native, Flutter, RN) which is difficult to do with WebRTC. The added throughput and latency should be similar to using TURN server with WebRTC. Websockets are the more common choice for signalling but HTTP/2.0 brings a new life to SSE.