onMessage hooks of the WebSocket V2 command.
Command Type
Command Type ID: 6Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| encoding | string | The encoding/compression scheme. Possible values: "base64+lz4", "base64+gzip" | No |
Usage Examples
Decode a SignalR LZ4 Message
Used insideonMessage of a WebSocket V2 command:
Decode a gzip Payload
Auto-Detect Encoding
Whenencoding is omitted, the command attempts to detect and unwrap the payload automatically:
Common Use Cases
- SignalR Feeds: SignalR often wraps messages in base64+LZ4 envelopes; this command unwraps them into plain JSON
- Compressed Streams: Decompress gzip-encoded WebSocket messages before parsing
Related Commands
- WebSocket V2 - The parent command where this is used as an
onMessagehook - Decode (Parse) - Parse-side decode command for HTTP/browser data