REDWEBHTTP + WebSocket infrastructure
Small setup. Clear ownership.

HTTP and WebSockets,without the ceremony.

Redweb is a small Node.js foundation for serving web apps, APIs, and real-time features. Start an Express server, add typed WebSocket routes, or put both on one listener—without hiding the pieces you still want to control.

Node 18+CommonJSExpress + wsOpt-in controlsNo mandatory broker
One Node listener
Web on one side. Realtime on the other.
3030
1Express application
2Static files + JSON APIs
3WebSocket upgrades
4Route-based message handlers
5One explicit shutdown path

Use Redweb’s listener defaults, or supply your own server and keep control of when it starts and stops.

HTTP
Express routes and static files
WS
JSON and raw binary handlers
1 port
shared HTTP + socket listener
Opt-in
multiplayer production controls
The useful parts, already connected

A clean starting point that stays understandable.

Redweb removes repetitive wiring while leaving Express, Node servers, WebSocket routes, and handler classes visible and ordinary.

HTTP and HTTPS

Express, already arranged

Serve static files, JSON APIs, middleware, and optional HTMX rendering without repeating the same server setup.

WebSockets

Messages find their handler

Give each socket path a route and each JSON message a type. Redweb handles upgrades, clients, binary frames, and lifecycle.

Composition

One server when you want it

Build the Express app without listening, attach WebSocket routes to the same Node server, then own one port and one shutdown path.

When realtime becomes multiplayer

Grow into stricter controls, route by route.

The simple path stays simple. When a game route needs more, opt into bounded rooms, sessions, admission, backpressure, protocol evolution, distribution, and draining without changing every other route.

Rooms

Bounded, route-local membership with deterministic disconnect cleanup.

Sessions

Application-issued resumable ownership with expiry and atomic takeover.

Fixed ticks

Drift-aware, non-overlapping simulation steps with bounded catch-up.

Protocol

Version negotiation, stable envelopes and codes, generated types, and codec hooks.

Distribution

A small broker seam with bounded fan-out and honest best-effort semantics.

Observability

Low-cardinality metrics for capacity, failures, readiness, rooms, and connections.

One small setup

HTTP and sockets share the server you already understand.

Build the Express side without binding, attach WebSocket routes to its Node server, then listen once. The detailed route, lifecycle, binary, and multiplayer APIs live in the reference.

Open the full API reference
server.jsredweb
const { HttpServer, SocketServer } = require('redweb');

const http = new HttpServer({
  port: 3030,
  listen: false,
  publicPaths: ['./public'],
  services: [healthEndpoint],
});

new SocketServer({
  server: http.server,
  routes: [ChatRoute, PresenceRoute],
});

http.server.listen(3030);
Start with the web. Add realtime. Grow deliberately.

A small base for things that need to move.