@autofleet/network 1.2.9-alpha-3 → 1.2.9-alpha-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +12 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -44,8 +44,18 @@ module.exports = class Network {
44
44
  constructor(settings = {}) {
45
45
  this.settings = merge(defaultSettings, settings);
46
46
  if (this.settings.keepAlive) {
47
- const keepaliveAgent = new Agent();
48
- const keepaliveHttpsAgent = new HttpsAgent();
47
+ const keepaliveAgent = new Agent({
48
+ maxSockets: 100,
49
+ maxFreeSockets: 10,
50
+ timeout: 60000, // active socket keepalive for 60 seconds
51
+ freeSocketTimeout: 30000, // free socket keepalive for 30 seconds
52
+ });
53
+ const keepaliveHttpsAgent = new HttpsAgent({
54
+ maxSockets: 100,
55
+ maxFreeSockets: 10,
56
+ timeout: 60000, // active socket keepalive for 60 seconds
57
+ freeSocketTimeout: 30000, // free socket keepalive for 30 seconds
58
+ });
49
59
  this.settings.httpAgent = keepaliveAgent;
50
60
  this.settings.httpsAgent = keepaliveHttpsAgent;
51
61
  delete this.settings.keepAlive;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/network",
3
- "version": "1.2.9-alpha-3",
3
+ "version": "1.2.9-alpha-4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {