diff --git a/examples/pub_sub.js b/examples/pub_sub.js index d64cc428d8..595cae6e91 100644 --- a/examples/pub_sub.js +++ b/examples/pub_sub.js @@ -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 +});