Skip to main content
Unsupported HAIP 1 archive. This is historical chat and streaming documentation, not the HAIP 2 review protocol. Its APIs, package examples and security advice must not be used for a HAIP 2 deployment. Start with the current HAIP 2 guides.

Overview

HAIP supports binary frame transmission for efficient handling of audio, video, and file data. Binary frames are sent as separate WebSocket frames after the JSON envelope, providing optimal performance for large binary payloads.

Binary Frame Structure

Envelope Format

Binary data in HAIP uses a two-frame approach:
  1. JSON Envelope: Contains metadata about the binary data
  2. Binary Frame: Contains the actual binary data

Audio Data Transmission

Sending Audio Chunks

Receiving Audio Data

File Data Transmission

Sending Files

Receiving Files

Video Data Transmission

Sending Video Frames

Binary Frame Best Practices

Memory Management

Error Handling

Best Practices

Memory Management

Implement proper memory management for binary buffers to prevent memory leaks.

Chunking

Break large files into manageable chunks for efficient transmission.

MIME Validation

Validate MIME types and file formats for security and compatibility.

Error Recovery

Robust error handling for corrupted or incomplete binary data.