building-websocket-server
Skill by jeremylongshore
Builds scalable WebSocket servers for real-time bidirectional communication, with rooms, broadcasting, heartbeats and Redis pub/sub scaling. Aimed at developers adding real-time features or a real-time API to an existing HTTP server.
Install building-websocket-server
Built from the published package, never by AI.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/building-websocket-server ~/.claude/skills/building-websocket-serverRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install building-websocket-server in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/building-websocket-server ~/.gemini/antigravity-cli/skills/building-websocket-serverAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install building-websocket-server in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The building-websocket-server skill helps an AI assistant build WebSocket servers for real-time bidirectional communication. It supports the ws library, Socket.IO, and native framework WebSocket support, with prerequisites listed for Node.js, Python, and Go. The skill covers connection lifecycle management, room and channel subscriptions, message broadcasting, and heartbeat keepalive.
The skill also covers authentication during the handshake using JWT or session tokens, and horizontal scaling with a Redis pub/sub adapter. Its steps include examining the existing HTTP server, building a connection registry, and writing lifecycle tests. It is aimed at developers who need to add real-time features or a real-time API to an existing server.
Written from the project's SKILL.md and checked against it.
What it can do
- Upgrade handlingAttaches a WebSocket server to the existing HTTP server with a configured upgrade path and allowed origins.
- Handshake authenticationValidates JWT tokens or session cookies during the WebSocket upgrade and rejects unauthorized connections.
- Connection registryTracks active clients with metadata such as user ID, subscribed channels and connection time.
- Message protocolDefines JSON envelopes with type, channel, payload and correlationId fields.
- Room subscriptionsLets clients join and leave named channels with server-side membership tracking.
- Heartbeat keepaliveRuns ping/pong with a configurable interval, default 30s, and timeout detection to clean up stale connections.
- Redis scalingConfigures a Redis pub/sub adapter so broadcasts reach clients across all server instances.
- Lifecycle testsWrites tests for connect, authenticate, subscribe, message exchange, reconnect and graceful disconnect.
What you need
- Node.js 18+ with ws or socket.io, or Python 3.10+ with websockets or FastAPI, or Go with gorilla/websocket
- Redis for horizontal scaling
- Load balancer configured for WebSocket upgrade
- JWT or session-based authentication
Try asking
- Build a WebSocket server attached to my existing HTTP server
- Add JWT authentication to my WebSocket handshake
- Set up a Redis pub/sub adapter so messages reach all server instances
Good to know
- The source lists Claude Code as the designed compatibility target.
- The full implementation guide and error patterns are in separate reference files.
Security check
B- Allowed to use Write, Edit without limitsIn
SKILL.md
Checked automatically: skills/.curated/building-websocket-server/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadWriteEditGrepGlobBash(api:websocket-*)
-
SKILL.md5 KB -
references/errors.md1 KB -
references/examples.md8 KB -
references/implementation.md2 KB
Alternatives to building-websocket-server
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
building-websocket-server: common questions
Which WebSocket libraries and languages does it support?
The source names the ws library, Socket.IO and native framework support for Node.js, plus websockets, FastAPI and gorilla/websocket for Python and Go.
How does it handle stale or dropped connections?
It uses a heartbeat ping/pong with a default 30s interval and timeout detection, and runs a cleanup sweep every 60s on the connection registry.
How does it scale to multiple servers?
It configures a Redis pub/sub adapter so messages broadcast from any server instance reach all connected clients across the cluster.
How do I install building-websocket-server?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is building-websocket-server free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is building-websocket-server safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.
What are alternatives to building-websocket-server?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
