1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Update pub_sub example to show where to put auth.

This commit is contained in:
Matt Ranney
2011-02-22 21:59:57 -10:00
parent 29e09c1c16
commit 2534f740aa

View File

@@ -31,4 +31,12 @@ client1.on("message", function (channel, message) {
}); });
client1.incr("did a thing"); 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
});