You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Update pub_sub example to show where to put auth.
This commit is contained in:
@@ -31,4 +31,12 @@ client1.on("message", function (channel, message) {
|
||||
});
|
||||
|
||||
client1.incr("did a thing");
|
||||
client1.subscribe("a nice channel", "another one");
|
||||
|
||||
client1.on("ready", function () {
|
||||
// if you need auth, do it here
|
||||
client1.subscribe("a nice channel", "another one");
|
||||
});
|
||||
|
||||
client2.on("ready", function () {
|
||||
// if you need auth, do it here
|
||||
});
|
||||
|
Reference in New Issue
Block a user