A global terminal chat over HTTP streams (no WebSockets)

Wait 5 sec.

Hey everyone, I wanted to build a real-time distributed system without relying on WebSockets or heavy frameworks, so I engineered a zero-dependency multiplayer terminal lobby. You can jump in and test the edge latency right now: npx hacker-lobby The Stack Backend: Cloudflare Workers (Edge network). Database: Cloudflare D1 (SQLite). Connection: Dual-pipeline HTTP. The local Node client holds an open ReadableStream via Server-Sent Events (SSE) to listen, and fires standard POST requests to transmit. Security (Terminal XSS) Because this takes raw terminal input, I had to prevent ANSI escape code injections (e.g., \x1b[2J) so users can't wipe each other's screens or spoof system logs. I built a regex middleware on the Worker to strip control characters before they hit the database, alongside parameterized queries to prevent SQL injection. Repo: https://github.com/Spido7/terminal-chatting/ I’d love for you to jump in, test the latency, try to bypass the sanitization filter, or review the code. Let me know what you think. *(P.S. This is my first time posting a project here, so any feedback on the code or architecture is highly appreciated! If you like the concept, drop a ⭐ on the repo to help others find it.)* Edit: Hey everyone, the bot flagged this because the repo is brand new (created it this week). The code is completely open-source and zero-dependency in the link above—feel free to inspect index.js and the Cloudflare Worker code before running npx hacker-lobby to verify it's safe.   submitted by   /u/Front_Concern1075 [link]   [comments]