axum-impl-websockets

Official

Ship robust WebSocket endpoints in Axum.

AuthorImpertio-Studio
Version1.0.0
Installs0

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 optional on_failed_upgrade so upgrades succeed and failures are visible.
  • Right concurrency model: Avoid the sequential-only echo trap by using socket.split(), tokio::spawn, and tokio::select! for true concurrent send/receive.
  • Version-aware Message handling (0.7 → 0.8): Migrate Message payload construction and pattern matching from String/Vec<u8> to Utf8Bytes/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 required

Components

references

💻 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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.