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) {