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

Server-Sent Events (SSE) provides a simple way to implement HAIP for scenarios where you need one-way streaming from server to client. SSE is ideal for notifications, live updates, and scenarios where the client primarily receives data.

SSE Implementation

Client-Side SSE

Server-Side SSE

SSE with HTTP Streaming

Alternative Implementation

SSE Best Practices

Connection Management

Message Buffering

SSE vs WebSocket Comparison

Best Practices

Automatic Reconnection

SSE automatically reconnects, but monitor connection health and handle edge cases.

Message Buffering

Buffer messages on the client side to handle temporary disconnections.

HTTP Headers

Set proper SSE headers for optimal performance and compatibility.

Error Handling

Handle SSE errors gracefully and provide fallback mechanisms.