gwsocket is a simple, standalone, language-agnostic, RFC6455 compliant WebSocket Server, written in C.


						

					
real-time access logs

How it Works?

Very simple, just redirect the output from your application (stdout) to a file (named pipe) and let gwsocket transfer the data to the browser — That's it.

For example, tailing your server's logs into the browser couldn't be easier
tail -f /var/log/nginx/access.log > /tmp/wspipein.fifo

You can also get the client's data into (stdin) your application. In fact, you can even send your favorite ncurses program's output to the browser. See this.

Why?

I was in the hunt for a fast, simple, no-dependencies, no libraries, RFC6455 compliant WebSocket Server written in C that I could use for version 1.0 of GoAccess by simply piping data in and out — WebSockets made easy!

Download

Download - v0.2 - 2016-10-11

Features

  • Message Fragmentation per section 5.4
  • UTF-8 Handling
  • Framing (Text & Binary messages)
  • Multiplexed non-blocking network I/O
  • Ability to pipe data in/out in two different modes (stdin/stdout & strict mode)
  • Origin-based restriction.
  • It passes the Autobahn Testsuite :)
  • and of course, Valgrind tested.
  • missing something?, please feel free to post it on Github.

More Examples?

gwsocket is language agnostic, look at the Man Page for more details and examples on how to receive data from the browser and how to send it to the browser.