New protocol version released: This page may contain outdated information.
Transport Types
WebSocket Transport
The default and most feature-complete transport, supporting real-time bidirectional communication. Features:- Real-time bidirectional communication
- Binary data support
- Automatic reconnection
- Flow control
- Heartbeat monitoring
WebSocket server URL (ws:// or wss://).
JWT authentication token.
Additional WebSocket-specific options.
Server-Sent Events (SSE) Transport
Browser-only transport using Server-Sent Events for receiving data and HTTP POST for sending. Features:- Browser-native support
- Automatic reconnection
- HTTP POST for sending messages
- Event stream parsing
SSE endpoint URL (http:// or https://).
JWT authentication token.
Additional SSE-specific options.
- Browser environment only
- No binary data support
- Unidirectional for receiving (uses HTTP POST for sending)
HTTP Streaming Transport
Universal transport using fetch streaming for both sending and receiving. Features:- Works in Node.js and browsers
- Fetch-based streaming
- Automatic reconnection
- Universal compatibility
HTTP streaming endpoint URL.
JWT authentication token.
Additional HTTP streaming options.
Transport Comparison
| Feature | WebSocket | SSE | HTTP Streaming |
|---|---|---|---|
| Environment | Node.js + Browser | Browser only | Node.js + Browser |
| Bidirectional | ✅ | ❌ (POST for sending) | ✅ |
| Binary Support | ✅ | ❌ | ✅ |
| Real-time | ✅ | ✅ | ✅ |
| Reconnection | ✅ | ✅ | ✅ |
| Flow Control | ✅ | ✅ | ✅ |
| Heartbeat | ✅ | ❌ | ❌ |
| Performance | Excellent | Good | Good |
| Compatibility | High | Medium | High |
Transport Selection
Choose WebSocket when:
- You need full bidirectional communication
- Binary data support is required
- Maximum performance is needed
- Both Node.js and browser environments
Choose SSE when:
- Browser-only application
- Server-sent events are preferred
- Simpler server implementation
- Real-time updates are the primary need
Choose HTTP Streaming when:
- Universal compatibility is required
- Fetch API is preferred
- Both Node.js and browser support needed
- Simpler deployment (no WebSocket server)
Transport Configuration
Global Configuration
Transport-Specific Configuration
Connection Management
Automatic Reconnection
All transports support automatic reconnection with exponential backoff:Manual Reconnection
Transport Events
All transports emit the same events:Transport Health Monitoring
Connection State
Performance Metrics
Transport Switching
You can switch transports by creating a new client:Transport Testing
Testing Different Transports
Next Steps
Client API
Learn about the client interface and methods.
Examples
See practical examples of transport usage.
Authentication
Understand authentication across different transports.
API Reference
Full API reference documentation.