Skip to content

Commit

Permalink
remove socket option, as we would need two sockets anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Feb 14, 2015
1 parent ab9805a commit f49d9f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -32,8 +32,6 @@ The following options are allowed:
- `key`: the name of the key to pub/sub events on as prefix (`socket.io`)
- `host`: host to connect to redis on (`localhost`)
- `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
- `subClient`: optional, the redis client to subscribe to events on

Expand Down
8 changes: 2 additions & 6 deletions index.js
Expand Up @@ -42,19 +42,15 @@ function adapter(uri, opts){
}

// opts
var socket = opts.socket;
var host = opts.host || '127.0.0.1';
var port = Number(opts.port || 6379);
var pub = opts.pubClient;
var sub = opts.subClient;
var prefix = opts.key || 'socket.io';

// init clients if needed
if (!pub) pub = socket ? redis(socket) : redis(port, host);
if (!sub) sub = socket
? redis(socket, { detect_buffers: true })
: redis(port, host, {detect_buffers: true});

if (!pub) pub = redis(port, host);
if (!sub) sub = redis(port, host, { detect_buffers: true });

// this server's key
var uid = uid2(6);
Expand Down

0 comments on commit f49d9f8

Please sign in to comment.