rewrite using node.js and sockjs