Как я понял, из http://socket.io/#how-to-use , node.js автоматически обслуживает файл socket.io на сервере.
Я установил socket.io с помощью npm install socket.io
и вижу, что он находится в node_modules
на один уровень выше корня сервера.
server.js:
var static = require('./plugins/node-static');
var socketIO = require('socket.io');
var clientFiles = new static.Server('./client');
var http = require('http');
httpServer = http.createServer(function (request, response) {
request.addListener('end', function () {
clientFiles.serve(request, response);
});
}).listen(8253);
var webSocket = socketIO.listen(httpServer);
webSocket.on('connection', function(client) { .....
index.html:
Chat