Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View client.js
1 2 3 4 5 6 7 8 9 10
// npm install -g shelljs
// sudo apt-get install socat
require('shelljs/global');
 
setInterval(function(){
for (var i = 0; i < 10; i++)
exec("echo 'process' | socat - UNIX-CONNECT:/tmp/noderepl.sock", {async: true})
}, 10)
 
// shjs client.js
View client.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
var repl = require('repl')
var net = require('net')
var fs = require('fs')
var sockpath = '/tmp/noderepl.sock'
process.on('uncaughtException', function(err) {
console.log(err.stack)
})
 
fs.unlink(sockpath, function() {
net.createServer(function (socket) {
var r = repl.start({
prompt: 'yippee ki yay '
, input: socket
, output: socket
, terminal: true
, useGlobal: false
})
r.on('exit', function () {
socket.end()
})
r.context.socket = socket
r.context.big = new Buffer(1000)
}).listen(sockpath)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.