diff --git a/lib/xcore.js b/lib/xcore.js index 519c665..cf073e4 100644 --- a/lib/xcore.js +++ b/lib/xcore.js @@ -39,7 +39,8 @@ XClient.prototype.init = function(stream) this.stream = stream; this.authHost = stream.remoteAddress; - this.authFamily = stream.remoteFamily; + // Node v0.10.x does not have stream.remoteFamily, so dig in to find it + this.authFamily = stream._getpeername ? stream._getpeername().family : stream.remoteFamily; if (!this.authHost || this.authHost === '127.0.0.1' || this.authHost === '::1') { this.authHost = os.hostname(); this.authFamily = null;