06 - WebSockets Architecture
Overview
Architecture Diagram

Core Components
1. WebSocket Proxy Server
2. Broker Adapters
3. Connection Pooling
Message Flow
Client Authentication Flow
Subscription Flow
Data Streaming Flow
Client Protocol
Message Format
Response Format
Performance Optimizations
1. Subscription Index (O(1) Lookup)
2. Message Throttling
3. Mode Mapping Pre-computation
Broker Adapter Structure
Configuration
Environment Variables
Symbol Limits by Broker
Broker
Max Symbols/Connection
Default Pool Size
Depth Levels
Frontend Integration
React Hook (useMarketData)
websocket_proxy/ Directory Structure
App Integration (app_integration.py)
Key Files Reference
File
Purpose
Last updated