Ruby Websocket Services with Websocketd
November 13 2014
Websocketd is a program similar to xinetd which allows users to host any command line application over a websocket by simply reading and writing to STDIN/STDOUT.
Let’s say we wanted to stream the AAPL stock quote to a live dashboard
After running the command below…
…the Ruby snippet could be served to a browser by running the following:
That’s all there is to it. You can now connect using a Websocket from any modern browser.
Try running this from your JS console to see all incoming messages from the server: