Skip to content

Latest commit

 

History

History
220 lines (98 loc) · 2.33 KB

client.wsclient.md

File metadata and controls

220 lines (98 loc) · 2.33 KB

Home > @holochain/client > WsClient

WsClient class

A WebSocket client which can make requests and receive responses, as well as send and receive signals.

Uses Holochain's WireMessage for communication.

Signature:

export declare class WsClient extends Emittery 

Extends: Emittery

Constructors

Constructor

Modifiers

Description

(constructor)(socket, url, options)

Constructs a new instance of the WsClient class

Properties

Property

Modifiers

Type

Description

options

WsClientOptions

socket

IsoWebSocket

url

URL | undefined

Methods

Method

Modifiers

Description

authenticate(request)

Authenticate the client with the conductor.

This is only relevant for app websockets.

close(code)

Close the websocket connection.

connect(url, options)

static

Instance factory for creating WsClients.

emitSignal(data)

Sends data as a signal.

request(request)

Send requests to the connected websocket.