跳到正文

crossws

活跃
h3js/crossws

优雅、类型完善的跨平台 WebSocket 服务器工具包,可运行在 Cloudflare Workers、Bun、Deno 和 Node.js 上。

在 GitHub 查看
星标
744
Fork
45
关注
744
未关闭 Issue
8

该介绍目前仅提供英文版本。

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 ws for 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.

按共同分类和标签排序的同类开源项目。

全部 Web 框架项目 →