feat: add --keep-alive-timeout CLI arg to adjust server keepalive and connection timeout
MODIFY
lib/cli/args.js
lib/cli/args.js
@@ -83,6 +83,15 @@ const serverArgs = [
`on this server`
}],
+ [['-ka', '--keep-alive-timeout'], {
+ required: false,
+ default: null,
+ dest: 'keepAliveTimeout',
+ type: 'int',
+ help: 'Number of seconds the Appium server should apply as both the keep-alive timeout ' +
+ 'and the connection timeout for all requests. Defaults to 600 (10 minutes).'
+ }],
+
[['-ca', '--callback-address'], {
required: false,
dest: 'callbackAddress',

MODIFY
lib/main.js
lib/main.js
@@ -158,14 +158,18 @@ async function main (args = null) {
}).filter(Boolean);
appiumDriver.plugins = plugins;
- let server = await baseServer({
+ const serverOpts = {
routeConfiguringFunction,
port: args.port,
hostname: args.address,
allowCors: args.allowCors,
basePath: args.basePath,
plugins,
- });
+ };
+ if (args.keepAliveTimeout) {
+ serverOpts.keepAliveTimeout = args.keepAliveTimeout * 1000;
+ }
+ let server = await baseServer(serverOpts);
if (args.allowCors) {
logger.warn('You have enabled CORS requests from any host. Be careful not ' +
'to visit sites which could maliciously try to start Appium ' +

feat: add --keep-alive-timeout CLI arg to adjust server keepalive and connection timeout