You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Add Unix socket example.
This commit is contained in:
15
examples/unix_socket.js
Normal file
15
examples/unix_socket.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
var redis = require("redis"),
|
||||||
|
client = redis.createClient("/tmp/redis.sock");
|
||||||
|
|
||||||
|
client.on("connect", function () {
|
||||||
|
console.log("Got Unix socket connection.")
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on("error", function (err) {
|
||||||
|
console.log(err.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.info(function (err, reply) {
|
||||||
|
console.log(reply.toString());
|
||||||
|
client.quit();
|
||||||
|
});
|
Reference in New Issue
Block a user