diff --git a/lib/jsonwp-proxy/proxy.js b/lib/jsonwp-proxy/proxy.js index 9dfee7bc8..019495cbd 100644 --- a/lib/jsonwp-proxy/proxy.js +++ b/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,11 +72,7 @@ class JWProxy { } cancelActiveRequests () { - try { - this._reqCancelSource.cancel('The request has been canceled'); - } finally { - this._activeRequests = []; - } + this._activeRequests = []; } endpointRequiresSessionId (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') {