Skip to content

Instantly share code, notes, and snippets.

@mranney
Created March 22, 2010 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mranney/340659 to your computer and use it in GitHub Desktop.
Save mranney/340659 to your computer and use it in GitHub Desktop.
repltest.js
var sys = require("sys"),
net = require("net"),
repl = require("repl");
nconnections = 0;
net.createServer(function (c) {
sys.error("Connection!");
nconnections += 1;
c.close();
}).listen(5000);
repl.start("node via stdin> ");
// note that the most recent repl started will steal the output from others
net.createServer(function (socket) {
repl.start("node via socket> ", socket);
}).listen("/tmp/node-repl-sock");
// to connect:
// socat READLINE UNIX-CONNECT:/tmp/node-repl-sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment