diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index da6fbe8..3399bbc 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartrequest', - version: '2.0.0', + version: '2.0.1', description: 'dropin replacement for request' } diff --git a/ts/smartrequest.plugins.ts b/ts/smartrequest.plugins.ts index dacdd27..acc6541 100644 --- a/ts/smartrequest.plugins.ts +++ b/ts/smartrequest.plugins.ts @@ -13,7 +13,6 @@ import * as smarturl from '@pushrocks/smarturl'; export { smartpromise, smarturl }; // third party scope -import agentkeepalive from 'agentkeepalive'; import formData from 'form-data'; -export { agentkeepalive, formData }; +export { formData }; diff --git a/ts/smartrequest.request.ts b/ts/smartrequest.request.ts index dd938a4..92531ee 100644 --- a/ts/smartrequest.request.ts +++ b/ts/smartrequest.request.ts @@ -57,9 +57,8 @@ const parseSocketPathAndRoute = (stringToParseArg: string) => { /** * a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls */ -const httpAgent = new plugins.agentkeepalive({ +const httpAgent = new plugins.http.Agent({ keepAlive: true, - freeSocketTimeout: 4000, maxFreeSockets: 1, maxSockets: 100, maxTotalSockets: 1000, @@ -68,7 +67,7 @@ const httpAgent = new plugins.agentkeepalive({ /** * a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls */ -const httpAgentKeepAliveFalse = new plugins.agentkeepalive({ +const httpAgentKeepAliveFalse = new plugins.https.Agent({ maxFreeSockets: 0, keepAlive: false, keepAliveMsecs: 0, @@ -77,7 +76,12 @@ const httpAgentKeepAliveFalse = new plugins.agentkeepalive({ /** * a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls */ -const httpsAgent = new plugins.agentkeepalive.HttpsAgent(); +const httpsAgent = new plugins.https.Agent({ + keepAlive: true, + maxFreeSockets: 1, + maxSockets: 100, + maxTotalSockets: 1000, +}); /** * a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls