var http = require('http'), fs = require('fs'), ws = require('websocket-server'); var httpServer = http.createServer(function (req, res) { var docroot = "public"; var response = function(data) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end(data); }; fs.readFile(docroot+req.url, function(err, data) { if(err) response(err.message); else response(data); }); }); var wsServer = ws.createS