Transport Overview
socket-serve supports two transport mechanisms for server-to-client communication:- Server-Sent Events (SSE) - Primary transport
- HTTP Polling - Fallback transport
Server-Sent Events (SSE)
SSE provides a persistent HTTP connection for server-to-client streaming.Characteristics
- Long-lived GET request
- Unidirectional (server to client only)
- Automatic browser reconnection
- Lower latency (50-200ms)
- Built into modern browsers
Implementation
Limitations
- Not supported in all environments
- Some proxies may buffer SSE
- Connection count limits per domain
HTTP Polling
HTTP polling makes periodic requests to check for new messages.Characteristics
- Regular GET requests (1-second interval)
- Works in all environments
- Higher latency (~1000ms)
- More resource-intensive
Implementation
Transport Selection
The client automatically selects the appropriate transport:Next Steps
- Architecture - System design overview
- State Management - Redis state handling
- API Reference - Complete API documentation