Skip to content

WebSocketPeerOptions

WebSocketPeerOptions = object

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:17

Construction options for WebSocketPeer.

readonly closeTimeoutMs: number

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:34

How long, in milliseconds, to wait for the peer’s side of the closing handshake before dropping the connection. Required.


readonly maxMessageSize: number

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:28

Largest message accepted, in bytes, all its fragments together; a larger one fails the connection with 1009. Required: messages are buffered whole before message fires.


readonly optional protocol?: string | null

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:37

The subprotocol the handshake settled on, or null.


readonly role: WebSocketRole

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:21


readonly transport: Transport

Defined in: packages/net-websocket/src/peer/websocket-peer.ts:19

The connection after the opening handshake, or an HTTP tunnel.