diff --git a/config/config.default.js b/config/config.default.js index f4b454cea0..f9f413badc 100644 --- a/config/config.default.js +++ b/config/config.default.js @@ -228,7 +228,7 @@ module.exports = appInfo => { * @property {Boolean} keepAlive - Enable http keepalive or not, default is true * @property {Number} freeSocketKeepAliveTimeout - socket keepalive max free time, default is 4000 ms. * @property {Number} timeout - socket max unative time, default is 30000 ms. - * @property {Number} maxSockets - max socket number of one host, default is Infinity. + * @property {Number} maxSockets - max socket number of one host, default is `Number.MAX_SAFE_INTEGER` @ses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER * @property {Number} maxFreeSockets - max free socket number of one host, default is 256. * @property {Boolean} enableDNSCache - Enable DNS lookup from local cache or not, default is false. */ @@ -236,7 +236,7 @@ module.exports = appInfo => { keepAlive: true, freeSocketKeepAliveTimeout: 4000, timeout: 30000, - maxSockets: Infinity, + maxSockets: Number.MAX_SAFE_INTEGER, maxFreeSockets: 256, enableDNSCache: false, dnsCacheMaxLength: 1000, diff --git a/docs/source/zh-cn/core/httpclient.md b/docs/source/zh-cn/core/httpclient.md index 281f89cfdc..607330b82d 100644 --- a/docs/source/zh-cn/core/httpclient.md +++ b/docs/source/zh-cn/core/httpclient.md @@ -264,7 +264,7 @@ exports.httpclient = { // 当 socket 超过 30 秒都没有任何活动,就会被当作超时处理掉 timeout: 30000, // 允许创建的最大 socket 数 - maxSockets: Infinity, + maxSockets: Number.MAX_SAFE_INTEGER, // 最大空闲 socket 数 maxFreeSockets: 256, // 是否开启本地 DNS 缓存,默认关闭,开启后有两个特性