Skip to content

Documents for @litert/websocket / Client / createClient

Function: createClient()

createClient(opts): IClient

Defined in: src/lib/Client.ts:364

Create a WebSocket client via plain HTTP.

The client will not connect to the server automatically. You need to call the connect method to establish the connection. Before calling connect, you must setup the event listeners to handle the events emitted during the connection.

Parameters

opts

IWsConnectOptions

The options for the connection.

Returns

IClient

The plain WebSocket client.