explaingit

unetworking/uwebsockets.js

9,081C++Audience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

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.

Mindmap

mindmap
  root((uWebSockets.js))
    What it does
      HTTP server
      WebSocket server
      High throughput
    Tech
      C++ core
      Node.js addon
      TypeScript support
    Use cases
      Real-time chat
      Live data feeds
      Multiplayer games
    Performance
      Beats Socket.IO
      Beats Fastify
      Bun core component
    Audience
      Backend developers
      Systems builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a real-time chat server that holds tens of thousands of simultaneous WebSocket connections on modest hardware.

USE CASE 2

Create a live data feed backend that pushes price updates or sensor readings to many clients at once.

USE CASE 3

Run a multiplayer game server that needs to handle high message throughput with minimal CPU overhead.

Tech stack

C++Node.jsJavaScriptTypeScriptWebSocket

Getting it running

Difficulty · moderate Time to first run · 30min

Installation points to a specific GitHub tag via npm, not the public registry, full API documentation is in separate linked docs rather than the README.

Some source files use Apache 2.0 (permissive), the rest is all-rights-reserved proprietary. Read the license carefully before modifying or forking.

In plain English

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.

Copy-paste prompts

Prompt 1
Using uWebSockets.js, write a Node.js server that accepts WebSocket connections and broadcasts any incoming message to all connected clients.
Prompt 2
With uWebSockets.js, create an HTTP endpoint that responds to GET requests with a JSON payload and a WebSocket endpoint on the same port.
Prompt 3
Show me how to set up uWebSockets.js to handle 10,000 simultaneous WebSocket connections, including how to install it from GitHub and start the server.
Open on GitHub → Explain another repo

← unetworking on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.