1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Add full IPv6 redis connection capability in a full IPv6 network or in a mix network (IPv4 and IPv6)

This commit is contained in:
migounette
2014-06-23 16:38:37 +02:00
parent c68b3f7bd3
commit 9c68a286b1
3 changed files with 19 additions and 6 deletions

View File

@@ -1182,16 +1182,21 @@ RedisClient.prototype.eval = RedisClient.prototype.EVAL = function () {
exports.createClient = function (port_arg, host_arg, options) {
var port = port_arg || default_port,
host = host_arg || default_host,
redis_client, net_client;
net_client = net.createConnection(port, host);
var cnxOptions = {
'port' : port_arg || default_port,
'host' : host_arg || default_host,
'family' : options.family || 'IPv4'
};
var redis_client, net_client;
net_client = net.createConnection(cnxOptions);
redis_client = new RedisClient(net_client, options);
redis_client.port = port;
redis_client.host = host;
redis_client.port = cnxOptions.port;
redis_client.host = cnxOptions.host;
return redis_client;
};