mirror of
https://github.com/danbulant/node-x11
synced 2026-06-13 19:52:22 +00:00
Fix remoteFamily on Node v0.10
This commit is contained in:
parent
a42f043768
commit
1f5e2310a6
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue