Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting different payload types (String, Blob, ArrayBuffer) #13

Closed
backkem opened this issue Sep 21, 2023 · 1 comment
Closed

Supporting different payload types (String, Blob, ArrayBuffer) #13

backkem opened this issue Sep 21, 2023 · 1 comment

Comments

@backkem
Copy link
Collaborator

backkem commented Sep 21, 2023

The explainer currently says:

await peerB.send("Hello from peer A!"); // or Blob or ArrayBuffer

I wanted to highlight the protocol impact of supporting both String, Blob and ArrayBuffer here. If we want the same type to be returned at the other side of the connection, this payload type needs to be communicated. This means the underlying protocol needs to support it. As an example, WebRTC DataChannels do this by 'sneaking' the payload type in the 'SCTP Payload Protocol Identifier' as defined here.

I didn't check if other protocols like QUIC have a good/common way of 'sneaking' this information outside/alongside the main data stream. If not, it may be preferable to specify a lightweight framing protocol that can be tunneled over any underlying binary stream.

This is somewhat related to #11 as the WebTransport API only deals in binary data.

@backkem
Copy link
Collaborator Author

backkem commented Dec 4, 2023

Considered closed by #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant