Documentation
Use
@fastify
Websocket
Functions
makeHandler

Function: makeHandler()

makeHandler<P, E>(options, keepAlive): WebsocketHandler

Defined in: src/use/@fastify/websocket.ts:35

Make a handler to use on a @fastify/websocket route. This is a basic starter, feel free to copy the code over and adjust it to your needs

Type Parameters

P extends undefined | Record<string, unknown> = undefined | Record<string, unknown>

E extends Record<PropertyKey, unknown> = Record<PropertyKey, never>

Parameters

options

ServerOptions<P, Extra & Partial<E>>

keepAlive

number = 12_000

The timout between dispatched keep-alive messages. Internally uses the ws Ping and Pongs to check that the link between the clients and the server is operating and to prevent the link from being broken due to idling.

Default

12_000 // 12 seconds

Returns

WebsocketHandler