websockets
Installation
SKILL.md
WebSockets
WebSockets provide a persistent connection between a client and server that both parties can use to start sending data at any time.
When to Use
- Chat Apps: Real-time messaging.
- Gaming: Multiplayer state synchronization (low latency).
- Collaborative Editing: Google Docs style co-authoring.
- Financial Dashboards: High-frequency trading updates.
Quick Start
// Server (Node.js with 'ws')
import { WebSocketServer } from "ws";
const wss = new WebSocketServer({ port: 8080 });