JS var server=require('http').createServer(); server.on('request', function(req, res) { console.log(' request '); }); server.on("connection",function (sock) { console.log('connection comming...'); /* sock.ondata=function (data) { console.log('data...'); console.log(data); } */ }); server.on("close",function (sock) { console.log('connection gone away...'); }); server.listen(8080);