Skip to content

Commit c74107c

Browse files
paddybyersRuben Bridgewater
authored andcommitted
Add mention of tls option
1 parent 1fa9f15 commit c74107c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ limits total amount of connection tries. Setting this to 1 will prevent any reco
212212
* `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.
213213
* `disable_resubscribing`: *false*; If set to `true`, a client won't resubscribe after disconnecting
214214
* `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.
215+
* `tls`: an object containing options to pass to [tls.connect](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback),
216+
to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel).
215217

216218
```js
217219
var redis = require("redis"),

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ function RedisClient (options) {
3636
// Copy the options so they are not mutated
3737
options = clone(options);
3838
events.EventEmitter.call(this);
39-
var self = this;
4039
var cnx_options = {};
4140
if (options.path) {
4241
cnx_options.path = options.path;
4342
this.address = options.path;
4443
} else {
45-
cnx_options.port = options.port || default_port;
44+
cnx_options.port = +options.port || default_port;
4645
cnx_options.host = options.host || default_host;
4746
cnx_options.family = (!options.family && net.isIP(cnx_options.host)) || (options.family === 'IPv6' ? 6 : 4);
4847
this.address = cnx_options.host + ':' + cnx_options.port;

test/lib/stunnel-process.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ StunnelProcess.prototype.clear = function() {
6262
};
6363

6464
StunnelProcess.prototype.stop = function(done) {
65-
if(this.stunnel) {
66-
this.stunnel.kill();
67-
}
65+
if (this.stunnel) {
66+
this.stunnel.kill();
67+
}
6868
};
6969

7070
module.exports = {

0 commit comments

Comments
 (0)