Reputation: 2579
I'm building an app that may take a bunch of bandwidth. Once a connection is established with a 3rd party, I'm curious if I can send data (not video or audio) losslessly from one client to another?
Technical challenges aside, would it be theoretically possible to set up a network like Bittorrent via WebRTC?
Does it require that the user give "permission" via one of those yellow bars at the top of the browser?
Upvotes: 4
Views: 1402
Reputation: 2386
Not only is it possible - it has been done.
For what you want to do, you will need to open a WebRTC data channel. This allows you to send any arbitrary data directly between the two browsers (assuming they can connect directly, otherwise, you will relay your data through a TURN server). The data sent can be marked as being lossy or lossless by the application, as well as ordered or un-ordered.
As for permission, today there is no user consent required. There have been some discussions around that (you can see here: https://bloggeek.me/webrtc-data-channels-explicitly-approved/)
If you are looking for an off-the-shelf implementation, check out https://webtorrent.io/
Upvotes: 5