该介绍目前仅提供英文版本。
Overview
crossws is an elegant, typed and simple toolkit for implementing cross-platform WebSocket servers. It comes from the UnJS/h3 ecosystem.
Features
- Integrates with Cloudflare Workers, Bun, Deno and Node.js, and any compatible web framework
- Prebundled with
wsfor Node.js, with an optional, much faster uWebSockets adapter - Extremely lightweight, tree-shakable conditional ESM exports
- A high-performance hooks API without per-connection callback creation
- Typed hooks and developer-friendly object inspection
Why it matters on Cloudflare
Write your WebSocket logic once with crossws hooks and run it on Workers today, or move it to another runtime later without rewriting it.