Introduction
The Virtufin WebSocket Manager provides centralized WebSocket connection management with gRPC API support and Dapr integration for distributed state persistence and pub/sub messaging.
What is WebSocket Manager?
WebSocket Manager is a distributed service that tracks and controls WebSocket connections across multiple instances. Rather than each service managing its own WebSocket connections, the WebSocket Manager centralizes:
- Connection Lifecycle: Connect, disconnect, list, and monitor connections
- Message Routing: Send correlated request-response messages or fire-and-forget broadcasts
- Publish Control: Dynamically start and stop publishing messages to topics
- Instance Ownership: Connections are owned by specific service instances with automatic recovery
Key Features
| Feature | Description |
|---|---|
| gRPC API | Full gRPC service definition with HTTP/JSON transcoding |
| Distributed State | Dapr-backed state store for connection metadata |
| Pub/Sub Integration | Dapr pub/sub for cross-instance messaging |
| Auto-Recovery | Detect and handle connection timeouts and dead instances |
| Correlated Messaging | Request-response pattern over WebSocket with timeout support |
| Multi-Client SDK | First-class SDKs for C#, Python, and TypeScript |
Architecture at a Glance
flowchart LR
SDK[C# / Python / TS Client] --> GRPC[gRPC API]
GRPC --> WS[WebSocketService]
WS --> STORE[(Distributed Store)]
WS --> EXT[External WebSocket Servers]
STORE --> DAPR[Dapr Runtime]
DAPR --> SS[(State Store)]
DAPR --> PS[(Pub/Sub)]
Use Cases
- Real-Time Notifications: Push events to connected WebSocket clients
- Chat & Collaboration: Manage WebSocket sessions for multi-user applications
- IoT Device Management: Track and communicate with connected devices
- Live Dashboards: Stream real-time data to browser-based dashboards
- Service Mesh: Coordinate WebSocket connections in a microservices architecture
Getting Started
- Read the Architecture Overview to understand the system design
- Follow the Getting Started guide to deploy your first instance
- Explore the API Reference for detailed endpoint documentation
- Choose your SDK: C#, Python, or TypeScript
Requirements
| Component | Version |
|---|---|
| .NET | 10.0+ |
| Dapr | 1.18+ |
| Protocol Buffers | proto3 |
Next Steps
- Architecture — Deep dive into system design and components
- API Reference — Complete gRPC endpoint documentation
- Services — Internal service architecture
- Configuration — Runtime configuration options
- C# SDK — .NET client library
- Python SDK — Python async gRPC client
- TypeScript SDK — TypeScript Connect-RPC client