hexo/node_modules/undici/docs/api/WebSocket.md

854 B

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