Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Tubesock

Tubesock is a little utility that pipes STDIN to a WebSocket (and back again).

installation

$ npm install -g tubesock

usage example

Pipe random numbers to tubesock:

$ while true; do
  ruby -e "puts rand(30) + 50";
  sleep 1;
  done | tubesock

Then you can read the data coming from the WebSocket:

ws = new WebSocket('ws://localhost:9999')
ws.onmessage = function () { ... }

Here it is connected to a graph:

bars.mkndrsn.com

options

--port

The port to open the WebSocket server on. Default 9999.

--send-options

The port to open the WebSocket server on. Default true.

custom options

As long as you don't set --send-options to false, any additional options you pass to tubesock will be sent to new client connections.

contributing

Do it!

About

STDIN to WebSocket

Resources

License

Releases

No releases published
You can’t perform that action at this time.