WebSocket
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.
Constructors
Properties
The WebSocket.binaryType property controls the type of binary data being received over the WebSocket connection.
The WebSocket.bufferedAmount read-only property returns the number of bytes of data that have been queued using calls to send() but not yet transmitted to the network.
The WebSocket.extensions read-only property returns the extensions selected by the server.
The WebSocket.readyState read-only property returns the current state of the WebSocket connection.
Functions
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
The WebSocket.send() method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data.