Last active
March 24, 2021 02:00
-
-
Save juliangruber/7877042 to your computer and use it in GitHub Desktop.
Revisions
-
juliangruber revised this gist
Dec 9, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ var server = new Server({ port: argv.port }); server.on('connection', function(ws) { var stream = Stream(ws); var ps = spawn(argv._[0], argv._.slice(1)); ps.stdout.pipe(stream).pipe(ps.stdin); stream.on('end', ps.kill.bind(ps)); }); -
juliangruber revised this gist
Dec 9, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ var server = new Server({ port: argv.port }); server.on('connection', function(ws) { var stream = Stream(ws); var ps = spawn(argv._[0], argv._.slice(1)); stream.pipe(ps.stdin); ps.stdout.pipe(stream); stream.on('end', ps.kill.bind(ps)); }); -
juliangruber revised this gist
Dec 9, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ # node-websocketd A lightweight node port of [websocketd](https://github.com/joewalnes/websocketd), originally written in go. ## Usage -
juliangruber created this gist
Dec 9, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # node-websocketd A lightweight node port of [websocketd](https://github.com/joewalnes/websocketd), written in go. ## Usage ```bash node-websocketd --port=8080 ./count.sh ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ var spawn = require('child_process').spawn; var Server = require('ws').Server; var Stream = require('websocket-stream'); var argv = require('optimist').argv; var server = new Server({ port: argv.port }); server.on('connection', function(ws) { var stream = Stream(ws); var ps = spawn(argv._[0], argv._.slice(1)); stream.pipe(process.stdin); process.stdout.pipe(stream); stream.on('end', ps.kill.bind(ps)); });