File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,9 @@ These are the available config options for making requests. Only the `url` is re
149
149
150
150
// `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
151
151
// and https requests, respectively, in node.js. This allows options to be added like
152
- // `keepAlive` that are not enabled by default.
152
+ // `keepAlive` that are not enabled by default before Node.js v19.0.0. After Node.js
153
+ // v19.0.0, you no longer need to customize the agent to enable `keepAlive` because
154
+ // `http.globalAgent` has `keepAlive` enabled by default.
153
155
httpAgent: new http.Agent ({ keepAlive: true }),
154
156
httpsAgent: new https.Agent ({ keepAlive: true }),
155
157
Original file line number Diff line number Diff line change @@ -154,7 +154,9 @@ These are the available config options for making requests. Only the `url` is re
154
154
155
155
// `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
156
156
// and https requests, respectively, in node.js. This allows options to be added like
157
- // `keepAlive` that are not enabled by default.
157
+ // `keepAlive` that are not enabled by default before Node.js v19.0.0. After Node.js
158
+ // v19.0.0, you no longer need to customize the agent to enable `keepAlive` because
159
+ // `http.globalAgent` has `keepAlive` enabled by default.
158
160
httpAgent: new http.Agent ({ keepAlive: true }),
159
161
httpsAgent: new https.Agent ({ keepAlive: true }),
160
162
Original file line number Diff line number Diff line change @@ -138,9 +138,10 @@ next_link: '/zh/docs/res_schema'
138
138
// 若都指定,这使用 `socketPath` 。
139
139
socketPath: null , // default
140
140
141
- // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
142
- // and https requests, respectively, in node.js. This allows options to be added like
143
- // `keepAlive` that are not enabled by default.
141
+ // `httpAgent` 和 `httpsAgent` 分别定义了在 node.js 中执行 http 和 https 请求时使用的自定义代理。
142
+ // 这允许添加诸如 `keepAlive` 之类的选项,这些选项在 Node.js v19.0.0 之前默认未启用。
143
+ // 在 Node.js v19.0.0 之后,不再需要自定义代理来启用 `keepAlive`,
144
+ // 因为 `http.globalAgent` 已经默认启用了 `keepAlive`。
144
145
httpAgent: new http.Agent ({ keepAlive: true }),
145
146
httpsAgent: new https.Agent ({ keepAlive: true }),
146
147
You can’t perform that action at this time.
0 commit comments