This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. The WebSoc

WebSocket - Web APIs | MDN

submited by
Style Pass
2025-08-06 15:30:07

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

Note: The WebSocket API has no way to apply backpressure, therefore when messages arrive faster than the application can process them, the application will either fill up the device's memory by buffering those messages, become unresponsive due to 100% CPU usage, or both. For an alternative that provides backpressure automatically, see WebSocketStream.

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

Fired when a connection with a WebSocket has been closed because of an error, such as when some data couldn't be sent. Also available via the onerror property.

Leave a Comment
Related Posts