socketio / socket.io-redis-emitter

The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process.
https://socket.io/docs/v4/redis-adapter/
MIT License
721 stars 121 forks source link

about redis and emitter?Missing redis 'host' #14

Closed excxapp closed 10 years ago

excxapp commented 10 years ago

In my app.js . first I

var Server = require('socket.io'); var io = new Server(30134); var redis = require('socket.io-redis');

io.adapter(redis({ host: '127.0.0.1', port: 6379 }));

and then

app.get("/ts", function (req, res) { var io = require('socket.io-emitter')(); // setInterval(function(){ // io.emit('time', new Date); // }, 5000);

//console.log(chat);    

});

The program get me an errror

mossing redis 'host' at new Emitter \node_modules\socket.io-emiiter\index.js 53:43

rase- commented 10 years ago

Ah, that's right. Thanks for reporting! The emitter also requires the host and port parameters in the constructor. I have updated the README to include this. Here's the changed row:

var io = require('socket.io-emitter')({ host: '127.0.0.1', port: 6379 });