mozilla / standards-positions

https://mozilla.github.io/standards-positions/
Mozilla Public License 2.0
634 stars 69 forks source link

WebSocketStream #970

Open ricea opened 7 months ago

ricea commented 7 months ago

Request for Mozilla Position on an Emerging Web Specification

Other information

WebSocketStream is a new API for the WebSocket protocol that enables backpressure by integrating with Streams. The benefits are better behaviour when one side cannot keep up with the data rate, and a more modern API.

valenting commented 7 months ago

@jesup @jan-ivar Considering your experience with the WebTransport API do you have any thoughts regarding this proposal?

smaug---- commented 6 months ago

@ricea the explainer talks about WebTransport as if it isn't a thing yet, but doesn't that have already multiple implementations. Is it not possible to support WebTransport API on top of various different kinds of network protocols?

(I don't personally have too strong opinions on WebSocketStream. The proposed API does look quite nice and simple when comparing to WebTransport which definitely is very complex)

@jesup @jan-ivar

ricea commented 6 months ago

@ricea the explainer talks about WebTransport as if it isn't a thing yet, but doesn't that have already multiple implementations. Is it not possible to support WebTransport API on top of various different kinds of network protocols?

Yes, sorry, I missed that part when I was updating the explainer. I fixed it in https://github.com/ricea/websocketstream-explainer/pull/22.

I think WebTransport over HTTP/2 will eventually be supported by browsers.

There is also a polyfill of the WebTransport API over WebSocket. Ironically, this would benefit from the backpressure support provided by WebSocketStream.