1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
Files
node-redis/examples/auth.js
2010-10-20 16:38:33 -07:00

14 lines
335 B
JavaScript

// Note - Eventually this functionality will be built in to the client library
var redis = require("redis"),
client = redis.createClient();
// whenever the client connects, make sure to auth
client.on("connect", function () {
client.auth("somepass", redis.print);
});
client.auth("somepass");
// then do whatever you want