You can write net.server by wrapping your node -ncurse server-side application, allowing telnet users to connect to the server, broadcast your application output to the connection, and connect it to your application.
#!/usr/bin/env node /** * widget.js is in node-ncurses examples */ var net = require('net'), child = require('child_process'), bin = child.spawn('./widget.js', ['InputBox']); var server = net.createServer(function(c) { console.log('server connected'); c.on('end', function() { console.log('server disconnected'); }); c.pipe(bin.stdin); bin.stdout.pipe(c); }).listen(8124, function() { console.log('server bound 8124'); }); // and let users: // $ telnet localhost 8124
toksea
source share