WebsocketAdapterOptionsType
Import
import { WebsocketAdapterOptionsType } from "@hyper-fetch/sockets"
Source
Package
Preview
type WebsocketAdapterOptionsType = {
autoConnect?: boolean;
decode?: (event: MessageEvent) => WebsocketDecodedMessageType | null;
encode?: (message: WebsocketEncodeMessageType) => WebsocketFrameType;
heartbeat?: boolean;
heartbeatMessage?: string;
pingTimeout?: number;
pongTimeout?: number;
protocols?: string | string[];
}
Structure
WebsocketAdapterOptionsType
| Name | Type | Description |
|---|---|---|
| autoConnect | | |
| heartbeat | | |
| heartbeatMessage | | |
| pingTimeout | | |
| pongTimeout | | |
| protocols | | Subprotocols passed to the
|
| decode | | Turns an incoming frame into a listener event - use it when the server does not send
(e.g.
|
| encode | | Turns an emitted message (and the heartbeat ping) into the frame passed to
|

