Agent skill · software engineering · secondsky

bun-websocket-server

This skill should be used when the user asks about "WebSocket in Bun", "real-time communication", "Bun.serve websocket", "ws server", "socket connections", "pub/sub", "broadcasting messages", "WebSocket upgrade", or building real-time applications with Bun.

Why this skill is useful

Provides specific code examples and patterns for implementing WebSocket servers in Bun, which the AI may not generate reliably on its own.

What it needs

Requires bun installed locally. About 3k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

Bun WebSocket Server Bun has built-in WebSocket support integrated with Bun.serve(). Quick Start WebSocket Handlers Sending Messages Attaching Data to Connections Pub/Sub (Topics) Broadcasting to All Clients Server-Level Publish WebSocket Options Client-Side Connection Authentication Common Errors Error Cause Fix ------- ------- ----- Upgrade failed Invalid request Check upgrade headers Connection closed Client disconnect Handle in close handler Message too large Exceeds maxPayloadLength Increase limit or chunk data Backpressure Slow client Check buffer, wait for drain Common Patterns Chat Room When to Load References Load references/compression.md when: perMessageDeflate configuration Compression tuning Binary message handling Load references/scaling.md when: Multiple server instances Redis pub/sub integration Horizontal scaling

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/bun-websocket-server

View the source on GitHub

Browse the @skills marketplace