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

Add mention of tls option

This commit is contained in:
Paddy Byers
2015-10-19 17:19:16 +01:00
committed by Ruben Bridgewater
parent 1fa9f15ae4
commit c74107c972
3 changed files with 6 additions and 5 deletions

View File

@@ -212,6 +212,8 @@ limits total amount of connection tries. Setting this to 1 will prevent any reco
* `family`: *IPv4*; You can force using IPv6 if you set the family to 'IPv6'. See Node.js [net](https://nodejs.org/api/net.html) or [dns](https://nodejs.org/api/dns.html) modules how to use the family type. * `family`: *IPv4*; You can force using IPv6 if you set the family to 'IPv6'. See Node.js [net](https://nodejs.org/api/net.html) or [dns](https://nodejs.org/api/dns.html) modules how to use the family type.
* `disable_resubscribing`: *false*; If set to `true`, a client won't resubscribe after disconnecting * `disable_resubscribing`: *false*; If set to `true`, a client won't resubscribe after disconnecting
* `rename_commands`: *null*; pass a object with renamed commands to use those instead of the original functions. See the [redis security topics](http://redis.io/topics/security) for more info. * `rename_commands`: *null*; pass a object with renamed commands to use those instead of the original functions. See the [redis security topics](http://redis.io/topics/security) for more info.
* `tls`: an object containing options to pass to [tls.connect](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback),
to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel).
```js ```js
var redis = require("redis"), var redis = require("redis"),

View File

@@ -36,13 +36,12 @@ function RedisClient (options) {
// Copy the options so they are not mutated // Copy the options so they are not mutated
options = clone(options); options = clone(options);
events.EventEmitter.call(this); events.EventEmitter.call(this);
var self = this;
var cnx_options = {}; var cnx_options = {};
if (options.path) { if (options.path) {
cnx_options.path = options.path; cnx_options.path = options.path;
this.address = options.path; this.address = options.path;
} else { } else {
cnx_options.port = options.port || default_port; cnx_options.port = +options.port || default_port;
cnx_options.host = options.host || default_host; cnx_options.host = options.host || default_host;
cnx_options.family = (!options.family && net.isIP(cnx_options.host)) || (options.family === 'IPv6' ? 6 : 4); cnx_options.family = (!options.family && net.isIP(cnx_options.host)) || (options.family === 'IPv6' ? 6 : 4);
this.address = cnx_options.host + ':' + cnx_options.port; this.address = cnx_options.host + ':' + cnx_options.port;

View File

@@ -62,9 +62,9 @@ StunnelProcess.prototype.clear = function() {
}; };
StunnelProcess.prototype.stop = function(done) { StunnelProcess.prototype.stop = function(done) {
if(this.stunnel) { if (this.stunnel) {
this.stunnel.kill(); this.stunnel.kill();
} }
}; };
module.exports = { module.exports = {