Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance for support for authentication to redis? #10

Closed
evanlucas opened this issue May 17, 2014 · 4 comments
Closed

Any chance for support for authentication to redis? #10

evanlucas opened this issue May 17, 2014 · 4 comments

Comments

@evanlucas
Copy link

No description provided.

@vanwagonet
Copy link

As a workaround, you can create the clients yourself:

var redis = require('socket.io-redis/node_modules/redis').createClient,
    ropts = {/* your redis options */}, subOpts = { detect_buffers:true },
    pub = ropts.socket ? redis(ropts.socket) : redis(ropts.port, ropts.host),
    sub = ropts.socket ? redis(ropts.socket, subOpts) : redis(ropts.port, ropts.host, subOpts),
if (ropts.pass) {
    pub.auth(ropts.pass, function(err) { if (err) { throw err; } });
    sub.auth(ropts.pass, function(err) { if (err) { throw err; } });
}
io.adapter(require('socket.io-redis')({
    pubClient:pub, subClient:sub
}));

@evanlucas
Copy link
Author

Yea, thats what I ended up doing. I appreciate it!

@rase-
Copy link
Contributor

rase- commented May 29, 2014

Not sure if this is something that should be added into the redis adapter. If you want anything "special" in your redis clients, you can just inject the instances in the adapter constructor as suggested by @thetalecrafter.

Thoughts @guille?

@rase-
Copy link
Contributor

rase- commented Aug 22, 2014

Closing after discussion in #11.

@rase- rase- closed this as completed Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants