Type Alias: WSSHandlerOptions<TRouter>
On this page
WSSHandlerOptions<
TRouter>:WSConnectionHandlerOptions<TRouter> &object
Defined in: packages/server/src/adapters/ws.ts:131
The options of applyWSSHandler.
Type declaration
dangerouslyDisablePong?
optionaldangerouslyDisablePong:boolean
Stops answering clients' pings. Meant for tests.
Default
falseexperimental_encoder?
optionalexperimental_encoder:Encoder
Encodes and decodes messages, for formats other than JSON. Experimental: it may change in any release.
Default
jsonEncoderkeepAlive?
optionalkeepAlive:object
Sends pings to each client and closes connections that stop answering.
keepAlive.enabled
enabled:
boolean
Whether to send pings.
Default
falsekeepAlive.pingMs?
optionalpingMs:number
How long a connection can be quiet before a ping, in milliseconds.
Default
30_000keepAlive.pongWaitMs?
optionalpongWaitMs:number
How long to wait for a pong before closing the connection, in milliseconds.
Default
5_000prefix?
optionalprefix:string
Only connections whose URL starts with this are served.
wss
wss:
WebSocketServer
The ws server to serve the router on.
Type Parameters
| Type Parameter |
|---|
TRouter extends AnyTRPCRouter |
See
https://trpc.io/docs/server/websockets#creating-a-websocket-server