diff --git a/lib/units/device/plugins/vnc/index.js b/lib/units/device/plugins/vnc/index.js index 7593e962..8ae2b69a 100644 --- a/lib/units/device/plugins/vnc/index.js +++ b/lib/units/device/plugins/vnc/index.js @@ -110,9 +110,11 @@ module.exports = syrup.serial() connState.sentFrameTime = connState.lastFrameTime } - screenStream.broadcastSet.insert(id, { - onStart: vncStartListener - , onFrame: vncFrameListener + conn.on('authenticated', function() { + screenStream.broadcastSet.insert(id, { + onStart: vncStartListener + , onFrame: vncFrameListener + }) }) conn.on('fbupdaterequest', function() { diff --git a/lib/units/device/plugins/vnc/util/connection.js b/lib/units/device/plugins/vnc/util/connection.js index 5041c675..270bcc98 100644 --- a/lib/units/device/plugins/vnc/util/connection.js +++ b/lib/units/device/plugins/vnc/util/connection.js @@ -253,6 +253,7 @@ VncConnection.prototype._read = function() { } debug('client security', this._clientSecurity) this._writeSecurityResult(VncConnection.SECURITYRESULT_OK) + this.emit('authenticated') this._changeState(VncConnection.STATE_NEED_CLIENT_INIT) } break