The screen websocket now sends ping messages every now and then, so that it won't get caught by nginx's proxy_read_timeout if the screen is off or not moving. Previously, nginx may have decided to kill the connection after a period of no activity.

This commit is contained in:
Simo Kinnunen
2017-01-25 17:46:23 +09:00
parent d1602e6b79
commit 5e9aa427e9
3 changed files with 43 additions and 35 deletions

View File

@@ -85,6 +85,12 @@ module.exports.builder = function(yargs) {
, type: 'number'
, default: process.env.SCREEN_JPEG_QUALITY || 80
})
.option('screen-ping-interval', {
describe: 'The interval at which to send ping messages to keep the ' +
'screen WebSocket alive.'
, type: 'number'
, default: 30000
})
.option('screen-port', {
describe: 'Port allocated to the screen WebSocket.'
, type: 'number'
@@ -129,9 +135,10 @@ module.exports.handler = function(argv) {
, storageUrl: argv.storageUrl
, adbHost: argv.adbHost
, adbPort: argv.adbPort
, screenWsUrlPattern: argv.screenWsUrlPattern
, screenJpegQuality: argv.screenJpegQuality
, screenPingInterval: argv.screenPingInterval
, screenPort: argv.screenPort
, screenWsUrlPattern: argv.screenWsUrlPattern
, connectUrlPattern: argv.connectUrlPattern
, connectPort: argv.connectPort
, vncPort: argv.vncPort