gitmyhub

uWebSockets.js

C++ ★ 9.1k updated 20d ago

μWebSockets for Node.js back-ends :metal:

A C++-powered Node.js web server library that handles HTTP and WebSockets at extreme throughput, benchmarked faster than Socket.IO and Fastify, and used as a core piece of the Bun runtime.

C++Node.jsJavaScriptTypeScriptWebSocketsetup: moderatecomplexity 4/5

uWebSockets.js is a web server library for Node.js back-ends built on about 10,000 lines of C++. It connects to Node.js as a native add-on, meaning it runs at C++ speed while still being usable from JavaScript or TypeScript code. The README describes it as one of the fastest standards-compliant web servers available, citing benchmark results that show it significantly outperforming Socket.IO and Fastify on the same hardware. It is also listed as a core component of the Bun JavaScript runtime.

The library handles HTTP and WebSocket connections. Its design emphasis is on raw throughput and low resource usage, which makes it relevant for applications that need to hold large numbers of simultaneous connections, such as real-time messaging, live data feeds, or multiplayer game servers. The README references a blog post demonstrating 100,000 secure WebSocket connections running on a Raspberry Pi 4, used to illustrate how efficient the library is at the low end of hardware.

Installation is done through the npm client but not through the public npm registry. The install command points directly at the GitHub repository with a specific version tag. Documentation and examples are linked from the README; the README itself is sparse and does not walk through full setup steps or API details inline.

Licensing is described as having two tiers. Some source files carry an Apache License 2.0 notice, which is a permissive open-source license. The rest of the intellectual property is listed as all rights reserved. The README advises reading the license terms carefully before modifying or forking the code.

Where it fits