From aed520a65387893062f6ed123171132a88fccffa Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 28 Apr 2017 13:11:12 -0600 Subject: [PATCH] get the correct remoteAddress if possible --- lib/goldilocks.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/goldilocks.js b/lib/goldilocks.js index 84efc70..7a0d377 100644 --- a/lib/goldilocks.js +++ b/lib/goldilocks.js @@ -359,8 +359,10 @@ module.exports.create = function (deps, config) { try { reader._remoteAddress = wrapOpts.remoteAddress; reader._remotePort = wrapOpts.remotePort; + reader._remoteFamily = wrapOpts.remoteFamily; reader._localAddress = wrapOpts.localAddress; reader._localPort = wrapOpts.localPort; + reader._localFamily = wrapOpts.localFamily; } catch(e) { } @@ -440,8 +442,9 @@ module.exports.create = function (deps, config) { servername: tlsSocket.servername , encrypted: true // remoteAddress... ugh... https://github.com/nodejs/node/issues/8854 - , remoteAddress: tlsSocket.remoteAddress || tlsSocket._handle._parent.owner.stream.remoteAddress - , remotePort: tlsSocket.remotePort || tlsSocket._handle._parent.owner.stream.remotePort + , remoteAddress: tlsSocket.remoteAddress || tlsSocket._remoteAddress || tlsSocket._handle._parent.owner.stream.remoteAddress + , remotePort: tlsSocket.remotePort || tlsSocket._remotePort || tlsSocket._handle._parent.owner.stream.remotePort + , remoteFamily: tlsSocket.remoteFamily || tlsSocket._remoteFamily || tlsSocket._handle._parent.owner.stream.remoteFamily }); });