diff --git a/lib/units/device/plugins/vnc/index.js b/lib/units/device/plugins/vnc/index.js index 8ae2b69a..2a697680 100644 --- a/lib/units/device/plugins/vnc/index.js +++ b/lib/units/device/plugins/vnc/index.js @@ -20,9 +20,13 @@ module.exports = syrup.serial() function createServer() { log.info('Starting VNC server on port %d', options.vncPort) + var opts = { + name: options.serial + } + var vnc = new VncServer(net.createServer({ allowHalfOpen: true - })) + }), opts) var listeningListener, errorListener return new Promise(function(resolve, reject) { diff --git a/lib/units/device/plugins/vnc/util/connection.js b/lib/units/device/plugins/vnc/util/connection.js index 6d219239..8ce5382e 100644 --- a/lib/units/device/plugins/vnc/util/connection.js +++ b/lib/units/device/plugins/vnc/util/connection.js @@ -5,7 +5,9 @@ var debug = require('debug')('vnc:connection') var PixelFormat = require('./pixelformat') -function VncConnection(conn) { +function VncConnection(conn, options) { + this.options = options + this._bound = { _errorListener: this._errorListener.bind(this) , _readableListener: this._readableListener.bind(this) @@ -34,7 +36,7 @@ function VncConnection(conn) { , blueShift: 0 }) this._requireServerPixelFormat = true - this._serverName = 'stf' + this._serverName = this.options.name this._clientVersion = null this._clientShare = false diff --git a/lib/units/device/plugins/vnc/util/server.js b/lib/units/device/plugins/vnc/util/server.js index 33b6c8e2..5a8b2382 100644 --- a/lib/units/device/plugins/vnc/util/server.js +++ b/lib/units/device/plugins/vnc/util/server.js @@ -5,7 +5,9 @@ var debug = require('debug')('vnc:server') var VncConnection = require('./connection') -function VncServer(server) { +function VncServer(server, options) { + this.options = options + this._bound = { _listeningListener: this._listeningListener.bind(this) , _connectionListener: this._connectionListener.bind(this) @@ -36,7 +38,7 @@ VncServer.prototype._listeningListener = function() { VncServer.prototype._connectionListener = function(conn) { debug('connection', conn.remoteAddress, conn.remotePort) - this.emit('connection', new VncConnection(conn)) + this.emit('connection', new VncConnection(conn, this.options)) } VncServer.prototype._closeListener = function() {