-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: Allow embedding tools to configure http.globalAgent.maxSockets
This commit adds support such that setting the `NODE_HTTP_MAX_SOCKETS` environment variable will allow Trireme to override the default `http.globalAgent.maxSockets` value of `5` with whatever value is in the aforementioned environment variable.
- Loading branch information
1 parent
c94d6ce
commit d27f215
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
node10/node10src/src/test/resources/tests/httpcustomdefaultmaxsockets.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var customMaxSockets = process.env.NODE_HTTP_MAX_SOCKETS = 10; | ||
|
||
var http = require('http'); | ||
var assert = require('assert'); | ||
|
||
assert.equal(http.globalAgent.maxSockets, customMaxSockets); |
4 changes: 4 additions & 0 deletions
4
node10/node10src/src/test/resources/tests/httpdefaultmaxsockets.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var http = require('http'); | ||
var assert = require('assert'); | ||
|
||
assert.equal(http.globalAgent.maxSockets, 5); |
6 changes: 6 additions & 0 deletions
6
node10/node10src/src/test/resources/tests/httpinvalidcustomdefaultmaxsockets.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var customMaxSockets = process.env.NODE_HTTP_MAX_SOCKETS = "invalid"; | ||
|
||
var http = require('http'); | ||
var assert = require('assert'); | ||
|
||
assert.equal(http.globalAgent.maxSockets, 5); |