qmetrics.net

websocketd

WebSocket wrapper for stdin and stdout CLI programs

websocketd screenshot

websocketd listens for WebSocket clients and runs a command per connection, piping messages to stdin and stdout lines back to the browser. No WebSocket library is needed in your program.

Overview

websocketd is a small server that exposes ordinary command-line programs over WebSockets, similar in spirit to inetd but for browser clients. Any executable that reads standard input and writes standard output can become an endpoint.

On each connection the server forks your program and tears it down when the client disconnects. Client messages arrive on stdin with a trailing newline; each stdout line becomes an outbound WebSocket text frame. STDERR can optionally be forwarded in tagged JSON.

The binary ships as a single downloadable executable for Linux, macOS, and Windows with minimal dependencies. It can also serve static files, route different programs to different URLs, run classic CGI, terminate TLS, enforce origin checks, and bind a Unix domain socket for local-only access.

A built-in developer console lets you test scripts before writing JavaScript clients. Examples cover many languages because the server stays language-agnostic.

Key features

  • One process per WebSocket connection
  • Language-agnostic stdio bridging
  • Static file and CGI modes
  • HTTPS and WSS support
  • Origin restriction options
  • Unix domain socket binding
  • Optional stderr forwarding
  • Built-in WebSocket debug console

Use cases

  • Browser-driven CLI tools
  • Live scripting demos
  • Simple interactive backends
  • Prototyping real-time UIs
  • Teaching WebSocket basics

Tags

Similar software

Kong Gateway

Cloud-native API, LLM, and MCP gateway with plugins

Kong Gateway centralizes proxying, routing, load balancing, and authentication for microservice APIs and AI traffic. It extends behavior through a plugin system and optional AI gateway features.

★ 44.4k⟳ 5 days agoApache-2.0

Envoy proxy

Cloud-native edge and service proxy

Envoy is a high-performance C++ proxy for edge, middle, and service mesh traffic. It abstracts networking with observability, security, and dynamic configuration.

★ 29.3k⟳ yesterdayApache-2.0

Apache APISIX

Cloud-native API gateway and AI traffic gateway

Apache APISIX is a dynamic, real-time API gateway built on NGINX and etcd. It manages north-south and east-west traffic and can act as a Kubernetes ingress controller.

★ 17.4k⟳ yesterdayApache-2.0

tproxy

CLI TCP connection proxy and analyzer

tproxy is a command-line tool to listen, relay, and inspect TCP traffic such as gRPC and MySQL connections for development debugging.

★ 3.7k⟳ 14 days agoMIT

Portr

Self-hosted HTTP, TCP and WebSocket tunnels for teams

Portr exposes local HTTP, TCP, and WebSocket services on public URLs through a tunnel server you control, with a local inspector, request replay, SQLite logs, and team access.

★ 3.2k⟳ 26 days agoAGPL-3.0
Open Source Alternative to:ngrok

NPort

Free Cloudflare-based localhost tunnel CLI with custom subdomains

NPort exposes local HTTP or HTTPS ports through Cloudflare with one npm command, automatic TLS and optional custom subdomains.

★ 776⟳ 3 months agoMIT
Open Source Alternative to:ngrok