Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 854 Bytes

WebSocket.md

File metadata and controls

20 lines (12 loc) · 854 Bytes

Class: WebSocket

⚠️ Warning: the WebSocket API is experimental and has known bugs.

Extends: EventTarget

The WebSocket object provides a way to manage a WebSocket connection to a server, allowing bidirectional communication. The API follows the WebSocket spec.

new WebSocket(url[, protocol])

Arguments:

  • url URL | string - The url's protocol must be ws or wss.
  • protocol string | string[] (optional) - Subprotocol(s) to request the server use.

Read More