Skip to main content
The Decode command (Command Type: 6) decodes base64+LZ4 or base64+gzip payloads (e.g., SignalR messages) into JSON. It also unwraps SignalR envelopes. Typically used inside onMessage hooks of the WebSocket V2 command.

Command Type

Command Type ID: 6

Parameters

ParameterTypeDescriptionRequired
encodingstringThe encoding/compression scheme. Possible values: "base64+lz4", "base64+gzip"No

Usage Examples

Decode a SignalR LZ4 Message

Used inside onMessage of a WebSocket V2 command:
{
  "id": 6,
  "type": "WS_V2",
  "params": {
    "encoding": "base64+lz4"
  }
}

Decode a gzip Payload

{
  "id": 6,
  "type": "WS_V2",
  "params": {
    "encoding": "base64+gzip"
  }
}

Auto-Detect Encoding

When encoding is omitted, the command attempts to detect and unwrap the payload automatically:
{
  "id": 6,
  "type": "WS_V2",
  "params": {}
}

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
  • WebSocket V2 - The parent command where this is used as an onMessage hook
  • Decode (Parse) - Parse-side decode command for HTTP/browser data