Websocket Events #

protocol:websocket:beforeParsingPayload #

Available since 2.19.12
ArgumentsTypeDescription
event
object
Client connection and raw payload

Triggered when a message is received on a WebSocket connection, before it is parsed.

The event object has the following properties:

PropertiesTypeDescription
connection
object
The client connection (id, protocol, ips, headers)
payload
string
The raw message

Pipes must resolve to an object of the same shape: its payload is the message that Kuzzle parses.

protocol:websocket:afterParsingPayload #

Available since 2.19.12
ArgumentsTypeDescription
event
object
Client connection and decoded payload

Triggered once a WebSocket message has been parsed as JSON.

The event object has the following properties:

PropertiesTypeDescription
connection
object
The client connection (id, protocol, ips, headers)
payload
JSONObject
The decoded message

Pipes must resolve to an object of the same shape: its payload becomes the API request.