Skip to content
Back to skills

Websocket

ASecurity

WebSocket implementation, connection management, scaling patterns, and real-time features.

  • 1,760 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentstypescriptbashbackendfullstack

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add a5c-ai/babysitter --skill websocket --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Websocket?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Websocket
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a5c-ai-websocket-98ae4771/badge)](https://www.skillsdirectory.com/skills/a5c-ai-websocket-98ae4771)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: websocket
description: WebSocket implementation, connection management, scaling patterns, and real-time features.
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
graph:
  domains: [domain:web-development]
  specializations: [specialization:web-development]
  skillAreas: [skill-area:websocket-design, skill-area:streaming-realtime-processing]
  roles: [role:backend-engineer, role:fullstack-engineer]
  topics: [topic:event-driven-architecture]

---

# WebSocket Skill

Expert assistance for implementing WebSocket real-time communication.

## Capabilities

- Implement WebSocket servers
- Handle connection lifecycle
- Build pub/sub patterns
- Scale with Redis adapter
- Implement reconnection logic
- Handle authentication

## Usage

Invoke this skill when you need to:
- Add real-time features
- Build chat applications
- Implement live updates
- Handle bidirectional communication

## Server Implementation

```typescript
import { WebSocketServer, WebSocket } from 'ws';
import { createServer } from 'http';

const server = createServer();
const wss = new WebSocketServer({ server });

const clients = new Map<string, WebSocket>();

wss.on('connection', (ws, req) => {
  const userId = authenticateConnection(req);
  clients.set(userId, ws);

  ws.on('message', (data) => {
    const message = JSON.parse(data.toString());
    handleMessage(userId, message);
  });

  ws.on('close', () => {
    clients.delete(userId);
  });
});

function broadcast(message: object) {
  const data = JSON.stringify(message);
  clients.forEach((client) => {
    if (client.readyState === WebSocket.OPEN) {
      client.send(data);
    }
  });
}
```

## Best Practices

- Implement heartbeat/ping-pong
- Handle reconnection gracefully
- Use message queues for scaling
- Authenticate connections

## Target Processes

- real-time-features
- chat-application
- live-updates

Files in this skill

  • README.md541 B
  • SKILL.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…