This PR adds a first outline for logic and API. It is not meant to be all-encompasing yet, just a step in the right (hopefully) direction.
Design considerations
The peer management section describes the core concept that the User Agent will be in control during explicit user consent, peer discovery and authentication. This improves privacy by not exposing peer lists to the JavaScript realm which would otherwise leak a user network topology details. In addition, this approach and UX is highly similar to that which is already in place for the Remote Playback and Presentation APIs (relates to #16).
The nomenclature of the Receiver and Request objects is inspired by the Presentation API.
The object-oriented nature of the API is inspired by the ORTC API.
I used the DataChannel API for message sending since it allows for sending different types like String, Blob and ArrayBuffer (#13) and supports multiple streams (#17).
I used an async API for the Receiver and Request where needed. I kept the DataChannel API close/equivalent to it's WebRTC counterpart. (relates to #14).
This PR adds a first outline for logic and API. It is not meant to be all-encompasing yet, just a step in the right (hopefully) direction.
Design considerations
Receiver
andRequest
objects is inspired by the Presentation API.async
API for theReceiver
andRequest
where needed. I kept theDataChannel API
close/equivalent to it's WebRTC counterpart. (relates to #14).Preview | Diff