explaingit

joewalnes/websocketd

Analysis updated 2026-06-24

17,455GoAudience · developerComplexity · 2/5Setup · easy

TLDR

Small Go command-line tool that turns any program reading STDIN and writing STDOUT into a WebSocket server, no networking code required.

Mindmap

mindmap
  root((websocketd))
    Inputs
      Any executable
      STDIN messages
      HTTP request env vars
    Outputs
      WebSocket messages from STDOUT
      Static files
      CGI responses
    Use Cases
      Wrap a Bash script as WebSocket server
      Stream live data to browser
      Prototype real time apps
    Tech Stack
      Go
      WebSocket protocol
      STDIN STDOUT
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

What do people build with it?

USE CASE 1

Expose a shell script as a live WebSocket endpoint for a browser dashboard

USE CASE 2

Stream output of a long-running CLI to a web page in real time

USE CASE 3

Prototype a WebSocket backend in Python or Bash without networking code

USE CASE 4

Serve a static frontend and its WebSocket backend from one binary

What is it built with?

GoWebSocket

How does it compare?

joewalnes/websocketdputyy/res-downloadertinygo-org/tinygo
Stars17,45517,43817,433
LanguageGoGoGo
Setup difficultyeasymoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Single static binary, just download and run with a port and your script path.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to run websocketd to wrap a Python script that emits JSON lines and have a browser page consume the messages
Prompt 2
Write a minimal HTML page that connects to a websocketd endpoint on localhost:8080 and prints incoming messages
Prompt 3
Give me a Bash script suitable for use behind websocketd that tails a log file and pushes new lines to the WebSocket
Prompt 4
Explain which environment variables websocketd sets so my script can read query parameters and cookies from the original HTTP request
Prompt 5
Walk me through installing the websocketd binary on Linux and starting it as a systemd service

Frequently asked questions

What is websocketd?

Small Go command-line tool that turns any program reading STDIN and writing STDOUT into a WebSocket server, no networking code required.

What language is websocketd written in?

Mainly Go. The stack also includes Go, WebSocket.

How hard is websocketd to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is websocketd for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub joewalnes on gitmyhub

Verify against the repo before relying on details.