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 is transport-agnostic, supporting multiple communication protocols. Choose the transport that best fits your use case and infrastructure requirements. WebSockets provide bidirectional, real-time communication with low latency and full-duplex capabilities.

Advantages

  • Bidirectional: Both client and server can send messages at any time
  • Low Latency: Minimal overhead for real-time applications
  • Full-Duplex: Simultaneous sending and receiving
  • Wide Support: Available in all modern browsers and platforms
See the WebSocket Implementation guide for detailed implementation examples.

Server-Sent Events (SSE)

SSE provides one-way streaming from server to client, ideal for scenarios where the client primarily receives data.

Advantages

  • Simple: Easy to implement and debug
  • Automatic Reconnection: Built-in reconnection handling
  • HTTP Compatible: Works through proxies and firewalls
  • Event-Driven: Native event handling
See the Server-Sent Events guide for detailed implementation examples.

HTTP Streaming

HTTP streaming provides a simple way to stream data over standard HTTP connections.

Advantages

  • Universal: Works with any HTTP client
  • Proxy Friendly: Passes through corporate firewalls
  • Simple: No special client libraries required
  • Compatible: Works with existing HTTP infrastructure
See the HTTP Streaming guide for detailed implementation examples.

Message Bus Integration

HAIP can be integrated with message buses like Redis, RabbitMQ, or Apache Kafka.

Redis Pub/Sub Example

Transport Selection Guide

WebSocket

Best for: Real-time chat, gaming, collaborative applications Pros: Bidirectional, low latency, full-duplex Cons: More complex, requires WebSocket support

Server-Sent Events

Best for: Notifications, live updates, one-way streaming Pros: Simple, automatic reconnection, HTTP compatible Cons: One-way only, limited browser support

HTTP Streaming

Best for: Simple integrations, proxy environments Pros: Universal, proxy friendly, simple Cons: Higher latency, no binary support

Message Bus

Best for: Microservices, distributed systems Pros: Scalable, decoupled, reliable Cons: Complex setup, additional infrastructure

Connection Management

Reconnection Strategies

Health Monitoring