Skip to content

Commit e360341

Browse files
author
Aaron Chambers
committed
Merge pull request #1 from nikz/master
Adds the ability to specify for tunnel-ssh config
2 parents aedf446 + 62db0c7 commit e360341

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ The port to forward from the server
8080

8181
*Default:* `6379`
8282

83+
### dstHost
84+
85+
The host to forward to on the destination server.
86+
87+
*Default:* `localhost`
88+
8389
### srcPort
8490

8591
The local port for the forwarding

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
name: options.name,
2020
defaultConfig: {
2121
dstPort: 6379,
22+
dstHost: 'localhost',
2223
srcPort: function() {
2324
var range = MAX_PORT_NUMBER - MIN_PORT_NUMBER + 1;
2425
return Math.floor(Math.random() * range) + MIN_PORT_NUMBER;
@@ -42,6 +43,7 @@ module.exports = {
4243
var sshConfig = {
4344
host: this.readConfig('host'),
4445
dstPort: this.readConfig('dstPort'),
46+
dstHost: this.readConfig('dstHost'),
4547
username: this.readConfig('username'),
4648
localPort: srcPort,
4749
privateKey: this.readConfig('privateKeyPath')

tests/unit/index-nodetest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ previous.push(current);
108108

109109
return previous;
110110
}, []);
111-
assert.equal(messages.length, 4);
111+
assert.equal(messages.length, 5);
112112
});
113113

114114
it('adds default config to the config object', function() {
@@ -124,6 +124,7 @@ previous.push(current);
124124
plugin.beforeHook(context);
125125
plugin.configure(context);
126126
assert.isDefined(config['ssh-tunnel'].dstPort);
127+
assert.isDefined(config['ssh-tunnel'].dstHost);
127128
assert.isDefined(config['ssh-tunnel'].srcPort);
128129
assert.isDefined(config['ssh-tunnel'].tunnelClient);
129130
assert.isDefined(config['ssh-tunnel'].privateKeyPath);

0 commit comments

Comments
 (0)