allinurl/gwsocket logo

allinurl/gwsocket

Free

fast, standalone, language-agnostic WebSocket server RFC6455 compliant

FreeFree tier
Type
Open Source

About allinurl/gwsocket

gwsocket is a simple, standalone, language-agnostic WebSocket server written in C, fully compliant with RFC6455. It acts as a bridge between your application and the client's browser, enabling fast bidirectional communication. Data is transferred by piping the application's stdout into gwsocket (via stdin or a named pipe), which then forwards it to connected browsers. It supports both broadcast mode via stdin/stdout and targeted messaging via a strict mode protocol. The server features message fragmentation, UTF-8 handling, multiplexed non-blocking I/O, and origin-based restriction. It passes the Autobahn Testsuite and is Valgrind tested, with no external dependencies beyond standard build tools.

Key Features

RFC6455 compliant WebSocket server
Language-agnostic: pipe data from any application via stdin or named pipe
Two data modes: stdin/stdout broadcast mode and strict mode for per-client messaging
Message fragmentation per RFC section 5.4
UTF-8 handling and framing (text and binary messages)
Multiplexed non-blocking network I/O
Origin-based restriction for security
Passes Autobahn Testsuite and Valgrind tested
No external dependencies (only requires gcc, make, autotools)

Pros & Cons

Pros
  • Extremely simple setup: just pipe data and it works
  • No external dependencies, easy to compile and deploy
  • Language-agnostic: works with any program that outputs to stdout
  • Compliant with WebSocket RFC6455 (passes Autobahn tests)
  • Supports both broadcasting and targeted client messaging
Cons
  • Broadcast mode limited to sending to all clients; targeted messaging requires strict mode
  • Written in C, requires compilation from source
  • No built-in SSL/TLS support (can be proxied via another server)
  • Not a full-featured WebSocket framework; focuses on piping data in/out

Best For

Real-time tailing of server logs directly into a browserStreaming output of ncurses or other terminal programs to multiple browser clientsBidirectional communication between shell scripts or applications and web frontendsSimple WebSocket relay for prototyping or lightweight production use

FAQ

How do I install gwsocket?
Download the tarball, extract, run './configure', 'make', then 'make install'. It requires only gcc, make, and autotools. No other dependencies are needed.
What is the difference between stdin/stdout mode and strict mode?
Stdin/stdout mode broadcasts all input data to every connected client. Strict mode uses a fixed-size header followed by payload, allowing you to send data to or receive from specific clients and track connection events.
Is gwsocket compliant with the WebSocket standard?
Yes, gwsocket is RFC6455 compliant and passes the Autobahn Testsuite for WebSocket servers.