Skip to content

Variable: WebSocket ​

ts
WebSocket: {
(url, protocols?): WebSocket;
  CLOSED: 3;
  CLOSING: 2;
  CONNECTING: 0;
  OPEN: 1;
  prototype: WebSocket;
};

Defined in: types/desktop-engine.d.ts:4116

Type Declaration ​

Connects to a ws(s) (or http(s)) URL. Throws a "SyntaxError" DOMException for a bad URL or subprotocols and a "SecurityError" one without the network permission; connection failures are error + close events instead

Parameters ​

ParameterType
url| string | URL | { toString: string; }
protocols?string | string[]

Returns ​

WebSocket

NameTypeDefined in
CLOSED3types/desktop-engine.d.ts:4151
CLOSING2types/desktop-engine.d.ts:4150
CONNECTING0types/desktop-engine.d.ts:4148
OPEN1types/desktop-engine.d.ts:4149
prototypeWebSockettypes/desktop-engine.d.ts:4142

The SDK is released under the Apache License 2.0