aj-geddes avatar

Websocket Implementation

This handles the full WebSocket stack from connection management to horizontal scaling with Redis adapters. You get reference implementations for Socket.IO servers, browser clients, Python with aiohttp, plus message protocols and room-based routing. The examples are production-minded, covering reconnection logic, rate limiting, and cleaning up dead connections. If you're building chat, live notifications, or collaborative features and need more than a basic tutorial, this gives you the patterns for handling thousands of concurrent connections without the common pitfalls. The best practices section is honest about what breaks at scale, like keeping unlimited history in memory or ignoring authentication.

skills.sh installs
668
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill websocket-implementation --agent claude-code

Installs into .claude/skills of the current project.

Files

WebSocket Implementation

Table of Contents

Overview

Build scalable WebSocket systems for real-time communication with proper connection management, message routing, error handling, and horizontal scaling support.

When to Use

  • Building real-time chat and messaging
  • Implementing live notifications
  • Creating collaborative editing tools
  • Broadcasting live data updates
  • Building real-time dashboards
  • Streaming events to clients
  • Live multiplayer games

Quick Start

Minimal working example:

const express = require("express");
const http = require("http");
const socketIo = require("socket.io");
const redis = require("redis");

const app = express();
const server = http.createServer(app);
const io = socketIo(server, {
  cors: { origin: "*" },
  transports: ["websocket", "polling"],
  reconnection: true,
  reconnectionDelay: 1000,
  reconnectionDelayMax: 5000,
  reconnectionAttempts: 5,
});

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Backend & APIs, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1alinaqi avatarsupabase-nextjsalinaqi/claude-bootstrapsupabase nextjs651skills.sh installs
2charon-fan avatarapi-documentercharon-fan/agent-playbookapi documenter641skills.sh installs
3charon-fan avatarapi-designercharon-fan/agent-playbookapi designer639skills.sh installs
4duck4nh avatarlinux-server-expertduck4nh/antigravity-kitLinux server administration expert. Ubuntu/Debian, Nginx, Apache, SSL, firewall, systemd, server hardening. Use for server setup and config.616skills.sh installs
5aj-geddes avatardatabase-backup-restoreaj-geddes/useful-ai-promptsImplement backup and restore strategies for disaster recovery. Use when creating backup plans, testing restore procedures, or setting up automated backups.588skills.sh installs
6alinaqi avatarsupabasealinaqi/claude-bootstrapsupabase587skills.sh installs