Add configurable request timeout to proxy
MODIFY
lib/jsonwp-proxy/proxy.js
lib/jsonwp-proxy/proxy.js
@@ -9,6 +9,7 @@ import { errors } from '../mjsonwp/errors';
const log = logger.getLogger('JSONWP Proxy');
// TODO: Make this value configurable as a server side capability
const LOG_OBJ_LENGTH = 1024; // MAX LENGTH Logged to file / console
+const REQUEST_TIMEOUT = 240000;
class JWProxy {
constructor (opts = {}) {
@@ -17,7 +18,8 @@ class JWProxy {
server: 'localhost',
port: 4444,
base: '/wd/hub',
- sessionId: null
+ sessionId: null,
+ timeout: REQUEST_TIMEOUT,
}, opts);
this.scheme = this.scheme.toLowerCase();
}
@@ -91,7 +93,7 @@ class JWProxy {
accept: '*/*',
},
resolveWithFullResponse: true,
- timeout: 240000,
+ timeout: this.timeout,
forever: true,
};
if (body !== null) {

Add configurable request timeout to proxy