fix: Disable request cancellation
MODIFY
lib/jsonwp-proxy/proxy.js
lib/jsonwp-proxy/proxy.js
@@ -36,12 +36,11 @@ class JWProxy {
});
this.scheme = this.scheme.toLowerCase();
this._activeRequests = [];
- this._reqCancelSource = axios.CancelToken.source();
this._downstreamProtocol = null;
const agentOpts = {
keepAlive: opts.keepAlive ?? true,
- maxSockets: 30,
- maxFreeSockets: 10,
+ maxSockets: 10,
+ maxFreeSockets: 5,
timeout: 60000,
};
this.httpAgent = new http.Agent(agentOpts);
@@ -73,12 +72,8 @@ class JWProxy {
}
cancelActiveRequests () {
- try {
- this._reqCancelSource.cancel('The request has been canceled');
- } finally {
this._activeRequests = [];
}
- }
endpointRequiresSessionId (endpoint) {
return !_.includes(['/session', '/sessions', '/status'], endpoint);
@@ -159,7 +154,6 @@ class JWProxy {
timeout: this.timeout,
httpAgent: this.httpAgent,
httpsAgent: this.httpsAgent,
- cancelToken: this._reqCancelSource.token,
};
// GET methods shouldn't have any body. Most servers are OK with this, but WebDriverAgent throws 400 errors
if (util.hasValue(body) && method !== 'GET') {

fix: Disable request cancellation (#430)