Comparing version 1.6.0 to 1.7.0
@@ -28,2 +28,3 @@ 'use strict'; | ||
* @param {string} [opts.identity] private key for public key authentication | ||
* @param {boolean} [opts.compression] use compression | ||
*/ | ||
@@ -45,2 +46,3 @@ __constructor: function (opts) { | ||
this._strictHostKeyChecking = opts.strictHostKeyChecking === undefined ? true : opts.strictHostKeyChecking; | ||
this._compression = opts.compression; | ||
this._identity = opts.identity; | ||
@@ -134,2 +136,5 @@ }, | ||
this._strictHostKeyChecking === false ? '-o StrictHostKeyChecking=no' : '', | ||
this._compression !== undefined ? | ||
util.format('-o Compression=%s', this._compression ? 'yes' : 'no') | ||
: '', | ||
this._identity ? util.format('-i %s', this._identity) : '', | ||
@@ -136,0 +141,0 @@ util.format('-p %d', this._sshPort), |
{ | ||
"name": "ssh-tun", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Module for establishing ssh tunnel", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -145,2 +145,24 @@ var Tunnel = require('../'), | ||
it('should spawn tunnel with "Compression" param if compression is provided', function () { | ||
tunnel = createTunnel({ | ||
compression: true | ||
}); | ||
tunnel.open(); | ||
var sshArgs = childProcess.spawn.lastCall.args[1]; | ||
expect(sshArgs).to.contain('-o Compression=yes'); | ||
}); | ||
it('should spawn tunnel without "Compression" param if compression is undefined', function () { | ||
tunnel = createTunnel(); | ||
tunnel.open(); | ||
var sshArgs = childProcess.spawn.lastCall.args[1]; | ||
expect(sshArgs).to.not.contain('-o Compression'); | ||
}); | ||
it('should resolve promise if tunnel successfully created', function () { | ||
@@ -147,0 +169,0 @@ tunnel = createTunnel(); |
21509
422