How to set up node.js interaction with shell application?

At:

node js interact with shell application

Trindaz linked to his YouTube video demonstrating how to interact with a bash shell (including interpreters available from the shell):

http://www.youtube.com/watch?v=16nFMucvwYQ

However I could not follow the frames from 20 seconds to 54 seconds. At 54 seconds the browser window shows:
....................................
connected
$ log in
$
.....................................

What are the steps required to get to this window? Any hints or guidance would be appreciated.

Thank you,

RP

I did not exactly replicate what is there in the video but I hope a sample like below should do it.

This is how I configured the server part.

var app = require('express').createServer(),
    io = require('socket.io').listen(app),
    sys = require('util'),
    exec = require('child_process').exec;

app.listen(4990);

io.sockets.on('connection', function(socket) {
    socket.on('console', function(command, callBack) {
        // client sends {command: 'ls -al'}
        function puts(error, stdout, stderr) {
            socket.emit('commandresult', stdout);
        }
        exec(command.command, puts);
    });
});​

I hope you can do the client part.

Hope this helps