mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Pass VNC server name in options.
This commit is contained in:
parent
4b03fd81b3
commit
02af21e17c
3 changed files with 13 additions and 5 deletions
|
@ -20,9 +20,13 @@ module.exports = syrup.serial()
|
||||||
function createServer() {
|
function createServer() {
|
||||||
log.info('Starting VNC server on port %d', options.vncPort)
|
log.info('Starting VNC server on port %d', options.vncPort)
|
||||||
|
|
||||||
|
var opts = {
|
||||||
|
name: options.serial
|
||||||
|
}
|
||||||
|
|
||||||
var vnc = new VncServer(net.createServer({
|
var vnc = new VncServer(net.createServer({
|
||||||
allowHalfOpen: true
|
allowHalfOpen: true
|
||||||
}))
|
}), opts)
|
||||||
|
|
||||||
var listeningListener, errorListener
|
var listeningListener, errorListener
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
|
|
|
@ -5,7 +5,9 @@ var debug = require('debug')('vnc:connection')
|
||||||
|
|
||||||
var PixelFormat = require('./pixelformat')
|
var PixelFormat = require('./pixelformat')
|
||||||
|
|
||||||
function VncConnection(conn) {
|
function VncConnection(conn, options) {
|
||||||
|
this.options = options
|
||||||
|
|
||||||
this._bound = {
|
this._bound = {
|
||||||
_errorListener: this._errorListener.bind(this)
|
_errorListener: this._errorListener.bind(this)
|
||||||
, _readableListener: this._readableListener.bind(this)
|
, _readableListener: this._readableListener.bind(this)
|
||||||
|
@ -34,7 +36,7 @@ function VncConnection(conn) {
|
||||||
, blueShift: 0
|
, blueShift: 0
|
||||||
})
|
})
|
||||||
this._requireServerPixelFormat = true
|
this._requireServerPixelFormat = true
|
||||||
this._serverName = 'stf'
|
this._serverName = this.options.name
|
||||||
|
|
||||||
this._clientVersion = null
|
this._clientVersion = null
|
||||||
this._clientShare = false
|
this._clientShare = false
|
||||||
|
|
|
@ -5,7 +5,9 @@ var debug = require('debug')('vnc:server')
|
||||||
|
|
||||||
var VncConnection = require('./connection')
|
var VncConnection = require('./connection')
|
||||||
|
|
||||||
function VncServer(server) {
|
function VncServer(server, options) {
|
||||||
|
this.options = options
|
||||||
|
|
||||||
this._bound = {
|
this._bound = {
|
||||||
_listeningListener: this._listeningListener.bind(this)
|
_listeningListener: this._listeningListener.bind(this)
|
||||||
, _connectionListener: this._connectionListener.bind(this)
|
, _connectionListener: this._connectionListener.bind(this)
|
||||||
|
@ -36,7 +38,7 @@ VncServer.prototype._listeningListener = function() {
|
||||||
|
|
||||||
VncServer.prototype._connectionListener = function(conn) {
|
VncServer.prototype._connectionListener = function(conn) {
|
||||||
debug('connection', conn.remoteAddress, conn.remotePort)
|
debug('connection', conn.remoteAddress, conn.remotePort)
|
||||||
this.emit('connection', new VncConnection(conn))
|
this.emit('connection', new VncConnection(conn, this.options))
|
||||||
}
|
}
|
||||||
|
|
||||||
VncServer.prototype._closeListener = function() {
|
VncServer.prototype._closeListener = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue