The WebSocket API (WebSockets)
The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user’s browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
Note: While a WebSocket connection is functionally somewhat similar to standard Unix-style sockets, they are not related.
The primary interface for connecting to a WebSocket server and then sending and receiving data on the connection.
The event sent by the WebSocket object when the connection closes.
The event sent by the WebSocket object when a message is received from the server.
- Read about reference in the Diátaxis framework