socket.io-redis
Advanced tools
Comparing version 0.1.1 to 0.1.2
0.1.2 / 2014-05-17 | ||
================== | ||
* check for default namespace before ignoring one | ||
0.1.1 / 2014-03-18 | ||
@@ -3,0 +8,0 @@ ================== |
12
index.js
@@ -43,2 +43,3 @@ | ||
// opts | ||
var socket = opts.socket; | ||
var host = opts.host || '127.0.0.1'; | ||
@@ -51,5 +52,8 @@ var port = Number(opts.port || 6379); | ||
// init clients if needed | ||
if (!pub) pub = redis(port, host); | ||
if (!sub) sub = redis(port, host, {detect_buffers: true}); | ||
if (!pub) pub = socket ? redis(socket) : redis(port, host); | ||
if (!sub) sub = socket | ||
? redis(socket, { detect_buffers: true }) | ||
: redis(port, host, {detect_buffers: true}); | ||
// this server's key | ||
@@ -92,2 +96,6 @@ var uid = uid2(6); | ||
var args = msgpack.decode(msg); | ||
if (args[0] && args[0].nsp === undefined) | ||
args[0].nsp = '/' | ||
if (!args[0] || args[0].nsp != this.nsp.name) return debug('ignore different namespace') | ||
@@ -94,0 +102,0 @@ args.push(true); |
{ | ||
"name": "socket.io-redis", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,5 +0,4 @@ | ||
# socket.io-redis | ||
[![Build Status](https://secure.travis-ci.org/LearnBoost/socket.io-redis.png)](http://travis-ci.org/LearnBoost/socket.io-redis) | ||
[![Build Status](https://secure.travis-ci.org/Automattic/socket.io-redis.png)](http://travis-ci.org/Automattic/socket.io-redis) | ||
[![NPM version](https://badge.fury.io/js/socket.io-redis.png)](http://badge.fury.io/js/socket.io-redis) | ||
@@ -12,3 +11,3 @@ | ||
var redis = require('socket.io-redis'); | ||
io.adapter(redis({ host: 'localhost', port: 6379 )); | ||
io.adapter(redis({ host: 'localhost', port: 6379 })); | ||
``` | ||
@@ -21,4 +20,3 @@ | ||
If you need to emit events to socket.io instances from a non-socket.io | ||
process, you should use | ||
[socket.io-emit](http:///github.com/learnboost/socket.io-emit). | ||
process, you should use [socket.io-emitter](http:///github.com/Automattic/socket.io-emitter). | ||
@@ -39,2 +37,4 @@ ## API | ||
- `port`: port to connect to redis on (`6379`) | ||
- `socket`: unix domain socket to connect to redis (`"/tmp/redis.sock"`). Will | ||
be used instead of the host and port options if specified. | ||
- `pubClient`: optional, the redis client to publish events on | ||
@@ -41,0 +41,0 @@ - `subClient`: optional, the redis client to subscribe to events on |
Sorry, the diff of this file is not supported yet
9202
209