websocket

Implement secure WebSocket services with origin validation and token authentication.

5|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/sinhong2011/minikyu --skill websocket-sinhong2011
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: websocket
Source: https://github.com/sinhong2011/minikyu/tree/main/.opencode/skill/websocket
Command: npx skills add https://github.com/sinhong2011/minikyu --skill websocket-sinhong2011

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical security challenges of real-time bidirectional communication via WebSockets, focusing on preventing common vulnerabilities like Cross-Site WebSocket Hijacking (CSWSH) and ensuring robust authentication and message validation.

Core Features & Use Cases

  • CSWSH Prevention: Implements strict origin validation and token-based authentication to block malicious hijacking attempts.
  • Secure Messaging: Ensures all messages are validated for format and that actions are authorized per-message.
  • Performance Optimization: Includes patterns for connection pooling, message batching, and efficient resource management.
  • Use Case: Securely enabling real-time chat features in a web application, ensuring only authenticated users from trusted origins can communicate, and preventing denial-of-service attacks through rate limiting.

Quick Start

Implement secure WebSocket communication by validating the origin and authenticating with a token.

Frequently Asked Questions about websocket

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

FAQPage Schema
How do I prevent Cross-Site WebSocket Hijacking (CSWSH) in a real-time application?

Prevent Cross-Site WebSocket Hijacking (CSWSH) by implementing strict origin validation and token-based authentication during the WebSocket handshake to block malicious connections from untrusted domains.

How does token-based authentication work with WebSocket connections?

Token-based authentication for WebSocket connections validates user identity during the initial handshake and enforces per-message authorization, ensuring only authenticated users can send or receive messages over the active session.

What is the best way to secure real-time bidirectional communication against denial-of-service attacks?

Secure real-time bidirectional communication against denial-of-service attacks by applying rate limiting, connection management patterns, and message integrity validation to control resource usage and drop malicious traffic.

How do I implement per-message authorization for a secure WebSocket service?

Implement per-message authorization for a secure WebSocket service by validating the format and checking user permissions for every incoming message, ensuring actions are explicitly authorized before processing.

Can I use connection pooling and message batching to optimize WebSocket performance?

You can optimize WebSocket performance using connection pooling and message batching patterns, which provide efficient resource management and reduce overhead for high-throughput real-time chat applications.

When do I need strict origin validation for WebSocket security?

You need strict origin validation for WebSocket security whenever your application exposes a real-time endpoint, as it prevents untrusted websites from establishing unauthorized WebSocket sessions with your server.