real-time

Configure WebSocket and Server-Sent Events for Node.js backends with authentication and Redis scaling.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill real-time
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: real-time
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/backend/real-time
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill real-time

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable reliable real-time communication in Node.js backends by guiding the choice and configuration of WebSocket or Server-Sent Events, implementing authentication and input validation, and ensuring messages reach clients across multiple instances with reconnection and scaling strategies.

Core Features & Use Cases

  • Socket.IO setup with authentication: middleware-based token verification, per-user rooms, and event handlers for messaging.
  • SSE endpoints: simple server-to-client streams for notifications and live feeds with automatic reconnection and keep-alive.
  • Rooms, namespaces & scaling: patterns for organizing channels, using Redis adapter for multi-instance broadcasting, and considerations for heavy payloads.
  • Reconnection and reliability: client reconnection strategies, heartbeats, session handling, and common gotchas to avoid (validation, rate limiting, graceful cleanup).
  • Use Case: implement a scalable chat and notification system that securely delivers messages to connected users across a cluster.

Quick Start

Use the real-time skill to implement a Node.js backend that uses Socket.IO with JWT authentication and a Redis adapter to support scaled chat and notification streams.

Frequently Asked Questions about real-time

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

FAQPage Schema
How do I scale Socket.IO across multiple Node.js instances?

Scale Socket.IO across multiple Node.js instances by configuring a Redis pub/sub adapter. This adapter synchronizes events across servers to ensure messages reach connected clients regardless of which instance they are connected to.

What is the best way to authenticate WebSocket connections in Node.js?

The best way to authenticate WebSocket connections in Node.js is by implementing middleware-based token verification. This approach validates user identity before allowing event handlers to process messages within rooms or namespaces.

Should I use WebSocket or Server-Sent Events for real-time notifications?

Use Server-Sent Events (SSE) for simple server-to-client notification streams with automatic reconnection. Choose WebSockets when you need bidirectional communication, such as in chat applications requiring client-to-server messaging.

How do I implement room-based broadcasting in a real-time chat backend?

Implement room-based broadcasting by organizing channels using Socket.IO rooms and namespaces. This pattern targets specific user groups for message delivery while integrating Redis adapters to maintain broadcast consistency across clustered instances.

Why do my WebSocket connections drop and fail to reconnect?

WebSocket connections drop and fail to reconnect due to improper heartbeat configuration and missing client reconnection strategies. Configuring keep-alive signals and session handling ensures reliable connection recovery during transient network failures.

Do I need Redis to use Socket.IO in Node.js?

You do not need Redis for a single-instance Socket.IO setup, but a Redis adapter is required to support scaled chat and notification streams across a multi-instance Node.js cluster.