websocket-engineer

Implement WebSocket and Socket.IO servers with authentication, rooms, and Redis-based horizontal scaling.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/ArMaTeC/Redball --skill websocket-engineer-armatec
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: websocket-engineer
Source: https://github.com/ArMaTeC/Redball/tree/main/.devin/skills/websocket-engineer
Command: npx skills add https://github.com/ArMaTeC/Redball --skill websocket-engineer-armatec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires socket.io, @socket.io/redis-adapter, redis, jsonwebtoken, ws, ioredis, uWebSockets.js, and includes references (resource) components.

What problem does it solve? Building real-time bidirectional communication systems is error-prone: developers must handle authentication, connection lifecycle, room management, reconnection, and horizontal scaling across multiple server instances, all of which behave differently from standard HTTP traffic. ## Core Features & Use Cases - Server Implementation: Set up Socket.IO servers with JWT authentication middleware, room and namespace management, and presence tracking backed by Redis. - Horizontal Scaling: Configure the Redis pub/sub adapter, sticky sessions with nginx or HAProxy, and connection limits for multi-instance deployments. - Client Resilience: Implement client-side reconnection with exponential backoff and message queuing during disconnection windows. - Use Case: You are building a chat application that must support thousands of concurrent users across multiple server instances. Use this Skill to implement authenticated Socket.IO connections, room-based messaging, presence tracking, and Redis-backed broadcasting that works across your entire cluster. ## Quick Start Use the websocket-engineer skill to build a Socket.IO chat server with JWT authentication, rooms, and Redis scaling.

Frequently Asked Questions about websocket-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scale Socket.IO across multiple servers?▼

Use the @socket.io/redis-adapter with Redis pub/sub so broadcasts reach clients on any instance. Configure sticky sessions on your load balancer (nginx ip_hash or HAProxy balance source) since WebSocket connections are stateful and must route to the same server.

How to authenticate WebSocket connections with JWT?▼

Pass the token in socket.handshake.auth and verify it in Socket.IO middleware with jwt.verify before the connection is established. Reject the connection by calling next with an error when the token is missing or invalid.

WebSocket vs SSE vs long polling: which should I use?▼

Use WebSocket for bidirectional, low-latency, high-frequency messaging like chat or games. Use SSE for one-way server-to-client feeds with automatic reconnection. Use long polling only as a fallback for legacy browsers or restrictive firewalls.

Why do WebSocket connections drop behind a load balancer?▼

Connections drop when the load balancer routes requests to different instances or when idle timeouts terminate the connection. Enable sticky sessions, configure long proxy read timeouts, and implement heartbeat ping/pong to detect dead connections.

How do I handle messages sent while a client is disconnected?▼

Queue messages client-side during disconnection and flush them on reconnect, or store them server-side in Redis or a database keyed by user ID. Deliver queued messages when the user reconnects to avoid silent data loss.