websocketd is a small command-line tool that turns any program that reads input and writes output into a WebSocket server, without writing any networking code. A WebSocket is a type of persistent connection between a browser and a server that lets them send messages back and forth in real time, unlike traditional web requests which close after each response. The tool works by wrapping your existing script or program. When a browser connects to websocketd via WebSocket, it starts your program as a subprocess. Anything the browser sends gets piped into your program's standard input (STDIN), and anything your program prints to standard output (STDOUT) gets sent back to the browser as a WebSocket message. When either side disconnects, the other is also disconnected. This means you can write a WebSocket server in Bash, Python, or any other language that can read from stdin and write to stdout, no networking libraries required. The quickstart example in the README demonstrates this with a Bash script that counts to 10: you run "websocketd --port=8080 ./count.sh" and immediately have a live WebSocket endpoint that streams numbers to any connected browser. Additional features include access to HTTP request details (like query parameters and cookies) via environment variables, a built-in static file server, a built-in CGI server, and a developer console for testing without building a frontend first. websocketd is a single executable (written in Go) with no external dependencies, available for Linux, Mac, and Windows.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.