From 31e29ab772af87aed1ed393f4d2fcba460c85a2a Mon Sep 17 00:00:00 2001 From: Victor Sklyar Date: Thu, 1 Oct 2015 10:47:49 +0300 Subject: [PATCH] Connection: pass localAddress to socket.connect() --- lib/Connection.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 1c7374f..4afbd21 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -56,6 +56,7 @@ function Connection(config) { config || (config = {}); this._config = { + localAddress: config.localAddress, socket: config.socket, socketTimeout: config.socketTimeout || 0, host: config.host || 'localhost', @@ -282,7 +283,11 @@ Connection.prototype.connect = function() { socket.destroy(); }, config.connTimeout); - socket.connect(config.port, config.host); + socket.connect({ + port: config.port, + host: config.host, + localAddress: config.localAddress + }); }; Connection.prototype.serverSupports = function(cap) {