supra-http
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -1,8 +0,5 @@ | ||
/// <reference types="node" /> | ||
import http from "http"; | ||
import https from "https"; | ||
import { ClientResponse, HttpRequestOptions } from "./types"; | ||
declare class Http { | ||
httpAgent: http.Agent; | ||
httpsAgent: https.Agent; | ||
httpAgent: any; | ||
httpsAgent: any; | ||
request(url: string, requestOptions: HttpRequestOptions, cb: (err: null | Error, clientResponse?: ClientResponse) => void): void; | ||
@@ -9,0 +6,0 @@ private createRequestOptions; |
@@ -12,9 +12,16 @@ "use strict"; | ||
const querystring_1 = require("querystring"); | ||
const AgentKeepAlive = require('agentkeepalive'); | ||
class Http { | ||
constructor() { | ||
this.httpAgent = new http_1.default.Agent({ | ||
keepAlive: true | ||
this.httpAgent = new AgentKeepAlive({ | ||
keepAlive: true, | ||
maxSockets: 2, | ||
maxFreeSockets: 2, | ||
keepAliveMsecs: 30000, | ||
}); | ||
this.httpsAgent = new https_1.default.Agent({ | ||
keepAlive: true | ||
this.httpsAgent = new AgentKeepAlive.HttpsAgent({ | ||
keepAlive: true, | ||
maxSockets: 2, | ||
maxFreeSockets: 2, | ||
keepAliveMsecs: 30000, | ||
}); | ||
@@ -21,0 +28,0 @@ } |
{ | ||
"name": "supra-http", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Circuit breaking http client for NodeJs. And it is fast...", | ||
@@ -26,2 +26,3 @@ "main": "./dist/index.js", | ||
"@types/opossum": "^4.0.0", | ||
"agentkeepalive": "^4.1.0", | ||
"fast-url-parser": "^1.1.3", | ||
@@ -34,3 +35,3 @@ "opossum": "^4.1.0", | ||
"@types/faker": "^4.1.6", | ||
"@types/jest": "^24.0.19", | ||
"@types/jest": "^24.9.1", | ||
"@types/node": "^12.11.2", | ||
@@ -37,0 +38,0 @@ "@types/sinon": "^7.5.0", |
Sorry, the diff of this file is not supported yet
49962
1146
5
+ Addedagentkeepalive@^4.1.0
+ Addedagentkeepalive@4.6.0(transitive)
+ Addedhumanize-ms@1.2.1(transitive)
+ Addedms@2.1.3(transitive)