diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index ef849f1..288927d 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -301,7 +301,7 @@ XClient.prototype.startHandshake = function() handshake.writeClientHello(this.pack_stream, this.displayNum, this.authHost); handshake.readServerHello(this.pack_stream, function(display) { - // TODO: readServerHello can set erro state in display + // TODO: readServerHello can set error state in display // emit error in that case client.expectReplyHeader(); client.display = display; @@ -316,17 +316,6 @@ XClient.prototype.require = function(extName, callback) ext.requireExt(this.display, callback); } -var platformLocalTransport = { - win32: 'tcp', - win64: 'tcp', - cygwin: 'tcp', - linux: 'unix', - - // OSX - darwin: 'unix' - // TODO: check process.platform on SmartMachine solaris box -} - module.exports.createClient = function(initCb, display) { if (!display) @@ -349,11 +338,14 @@ module.exports.createClient = function(initCb, display) // open stream var stream; var socketPath; - if ( process.platform.match(/win/).length > 0 ) + + // try local socket on non-windows platforms + if ( ['cygwin', 'win32', 'win64'].indexOf(process.platform) < 0 ) { if (process.platform == 'darwin') { - if (display[0] == '/') // local socket + // socket path on OSX is /tmp/launch-(some id)/org.x:0 + if (display[0] == '/') { socketPath = display; }