axum-impl-websockets
OfficialShip robust WebSocket endpoints in Axum.
System Documentation
What problem does it solve?
This Skill prevents common, production-impacting WebSocket implementation mistakes in Axum—especially around concurrency, upgrade failures, and Axum 0.7 to 0.8 Message type changes.
Core Features & Use Cases
- Correct WebSocket upgrade wiring: Use
WebSocketUpgrade,on_upgrade, and optionalon_failed_upgradeso upgrades succeed and failures are visible. - Right concurrency model: Avoid the sequential-only echo trap by using
socket.split(),tokio::spawn, andtokio::select!for true concurrent send/receive. - Version-aware Message handling (0.7 → 0.8): Migrate
Messagepayload construction and pattern matching fromString/Vec<u8>toUtf8Bytes/Bytes.
Use case example: You’re building a real-time chat hub where clients send messages and the server also broadcasts events; the Skill guides the correct split+select pattern and the right Axum 0.8 Message types.
Quick Start
Add WebSocket support by routing a WebSocketUpgrade handler, enabling the Cargo ws feature, and implementing an on_upgrade callback that uses a concurrent split+select loop for send/receive.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: axum-impl-websockets Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-impl-websockets Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.