fix(core): update

This commit is contained in:
Philipp Kunz 2022-07-29 15:41:32 +02:00
parent 557fec0386
commit 2d4a75c9cd
3 changed files with 10 additions and 7 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartrequest',
version: '2.0.0',
version: '2.0.1',
description: 'dropin replacement for request'
}

View File

@ -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 };

View File

@ -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