A heavenly real-time multiplayer meme party game.

- Year
- 2026
- Role
- Author
- Stack
- Node.js, WebSockets (RFC 6455), Vanilla JS, CSS
- Links
- Private
Overview
Everyone picks a template, writes the funniest caption, and the room reacts with real meme reactions. Built on a WebSocket server written from scratch – zero dependencies.
HolyMeme is a party game for friends in the same (virtual) room: create a lobby, share the code, caption a meme template against the clock and vote with reaction images. Whoever collects the most points becomes the Meme Saint.
There is no framework and no npm install. The server implements the WebSocket protocol (RFC 6455) on top of Node's `http` module, with connection limits per IP, idle timeouts, message rate limits, origin checks and strict security headers.

Implementation
01
WebSockets from first principles
Handshake, frame parsing, masking, ping/pong and close frames are implemented by hand – with hard caps on frame and buffer size so a single client can't exhaust memory.
02
A server-authoritative game loop
Rooms move through lobby, captioning, voting and results on the server; clients only render state, which keeps cheating and desync out.
Technical challenges
Open to the internet, safely
Per-IP limits on connections and room creation, idle timeouts, input normalisation and a strict CSP – learned the hard way that party games attract flooders.
Architecture
One Node process: an HTTP server for static files and the upgrade, a minimal WebSocket layer, and a GameServer that owns every room's state machine.
// RFC 6455: the accept key is the SHA-1 of the client key plus a fixed GUID
const accept = crypto
.createHash("sha1")
.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
.digest("base64");