CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 03:01:47 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/nodejs/node.git
etag: W/"4b6937932b81a043d646180f2ca5becb"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=8V2oLIAIkTw6tkt2IKKr7NmVLH2EcTQsF11XL7wYuPi0KRQd7TvQdOS%2F0qJon%2BLY3YSUOGNbOqRJcrpGzlrzSxMEcyGG2C%2B5500Hj%2B8DYSQL8G8kMHwBjA%2BlPezkhPUyt0xFmswqHL7cWAjJS1tq%2B8tuNwDK3JDX4w1hxShNFll9NqKQ00r9tey5M83iaSWD29mXXffKXU0O5gGNGhgds4Kie%2BLeAEV0i9Vjl9cTl9cAyKnk9I1bfhfk09GH0jWk670AJURnLGXuAc2JiUzuoA%3D%3D--BKOhgIHw6j09MKRs--10xkypsVT2GDog%2F3uGDARQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1743108305.1760238106; Path=/; Domain=github.com; Expires=Mon, 12 Oct 2026 03:01:46 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 12 Oct 2026 03:01:46 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9A6E:1321A5:59DDF8:795445:68EB1A1A
http,https: add built-in proxy support in http/https.request and Agent · nodejs/node@7f654ce · GitHub
Dismiss banner
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Commit 7f654ce
http,https: add built-in proxy support in http/https.request and Agent
This patch implements proxy support for HTTP and HTTPS clients and
agents in the `http` and `https` built-ins`. When NODE_USE_ENV_PROXY
is set to 1, the default global agent would parse the
HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
settings from the environment variables, and proxy the requests
sent through the built-in http/https client accordingly.
To support this, `http.Agent` and `https.Agent` now accept a few new
options:
- `proxyEnv`: when it's an object, the agent would read and parse
the HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
properties from it, and apply them based on the protocol it uses
to send requests. This option allows custom agents to
reuse built-in proxy support by composing options. Global agents
set this to `process.env` when NODE_USE_ENV_PROXY is 1.
- `defaultPort` and `protocol`: these allow setting of the default port
and protocol of the agents. We also need these when configuring
proxy settings and deciding whether a request should be proxied.
Implementation-wise, this adds a `ProxyConfig` internal class to handle
parsing and application of proxy configurations. The configuration
is parsed during agent construction. When requests are made,
the `createConnection()` methods on the agents would check whether
the request should be proxied. If yes, they either connect to the
proxy server (in the case of HTTP reqeusts) or establish a tunnel
(in the case of HTTPS requests) through either a TCP socket (if the
proxy uses HTTP) or a TLS socket (if the proxy uses HTTPS).
When proxying HTTPS requests through a tunnel, the connection listener
is invoked after the tunnel is established. Tunnel establishment uses
the timeout of the request options, if there is one. Otherwise it uses
the timeout of the agent.
If an error is encountered during tunnel establishment, an
ERR_PROXY_TUNNEL would be emitted on the returned socket. If the proxy
server sends a errored status code, the error would contain an
`statusCode` property. If the error is caused by timeout, the error
would contain a `proxyTunnelTimeout` property.
This implementation honors the built-in socket pool and socket limits.
Pooled sockets are still keyed by request endpoints, they are just
connected to the proxy server instead, and the persistence of the
connection can be maintained as long as the proxy server respects
connection/proxy-connection or persist by default (HTTP/1.1)
PR-URL: #58980
Refs: #57872
Refs: #8381
Refs: #15620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent 16dc53c commit 7f654ceCopy full SHA for 7f654ce
File tree
Expand file treeCollapse file tree
55 files changed
+3516
-37
lines changedFilter options
- doc/api
- lib
- internal
- process
- test
- client-proxy
- common
- fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
55 files changed
+3516
-37
lines changedCollapse file: doc/api/errors.md
+12Lines changed: 12 additions & 0 deletions
- Display the source diff
- Display the rich diff
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2489 | 2489 |
| |
2490 | 2490 |
| |
2491 | 2491 |
| |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2492 | 2504 |
| |
2493 | 2505 |
| |
2494 | 2506 |
| |
|
Collapse file: doc/api/http.md
+114Lines changed: 114 additions & 0 deletions
- Display the source diff
- Display the rich diff
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
119 | 127 |
| |
120 | 128 |
| |
121 | 129 |
| |
| |||
178 | 186 |
| |
179 | 187 |
| |
180 | 188 |
| |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
181 | 203 |
| |
182 | 204 |
| |
183 | 205 |
| |
| |||
4243 | 4265 |
| |
4244 | 4266 |
| |
4245 | 4267 |
| |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
| 4272 | + | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
4246 | 4360 |
| |
4247 | 4361 |
| |
4248 | 4362 |
| |
|
Collapse file: doc/api/https.md
+8Lines changed: 8 additions & 0 deletions
- Display the source diff
- Display the rich diff
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 |
| |
69 | 77 |
| |
70 | 78 |
| |
|
Collapse file: lib/_http_agent.js
+95-15Lines changed: 95 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 |
| |
38 | 45 |
| |
39 | 46 |
| |
| 47 | + | |
40 | 48 |
| |
41 | 49 |
| |
42 | 50 |
| |
| |||
45 | 53 |
| |
46 | 54 |
| |
47 | 55 |
| |
| 56 | + | |
48 | 57 |
| |
49 | 58 |
| |
50 | 59 |
| |
| |||
84 | 93 |
| |
85 | 94 |
| |
86 | 95 |
| |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 | 96 |
| |
91 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
92 | 101 |
| |
93 | 102 |
| |
94 | 103 |
| |
| |||
104 | 113 |
| |
105 | 114 |
| |
106 | 115 |
| |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
107 | 121 |
| |
108 | 122 |
| |
109 | 123 |
| |
| |||
200 | 214 |
| |
201 | 215 |
| |
202 | 216 |
| |
| 217 | + | |
| 218 | + | |
203 | 219 |
| |
204 | 220 |
| |
205 |
| - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
206 | 251 |
| |
207 | 252 |
| |
208 | 253 |
| |
| |||
227 | 272 |
| |
228 | 273 |
| |
229 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
230 | 285 |
| |
231 | 286 |
| |
232 | 287 |
| |
| |||
239 | 294 |
| |
240 | 295 |
| |
241 | 296 |
| |
| 297 | + | |
242 | 298 |
| |
243 | 299 |
| |
244 | 300 |
| |
| |||
264 | 320 |
| |
265 | 321 |
| |
266 | 322 |
| |
| 323 | + | |
267 | 324 |
| |
268 | 325 |
| |
269 | 326 |
| |
270 | 327 |
| |
271 | 328 |
| |
272 | 329 |
| |
273 | 330 |
| |
274 |
| - | |
275 | 331 |
| |
276 | 332 |
| |
277 |
| - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
278 | 336 |
| |
279 |
| - | |
280 |
| - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
281 | 341 |
| |
282 | 342 |
| |
283 | 343 |
| |
| |||
294 | 354 |
| |
295 | 355 |
| |
296 | 356 |
| |
| 357 | + | |
297 | 358 |
| |
298 | 359 |
| |
299 | 360 |
| |
300 | 361 |
| |
301 | 362 |
| |
302 | 363 |
| |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
303 | 370 |
| |
304 | 371 |
| |
305 | 372 |
| |
306 |
| - | |
| 373 | + | |
307 | 374 |
| |
308 | 375 |
| |
309 | 376 |
| |
| |||
321 | 388 |
| |
322 | 389 |
| |
323 | 390 |
| |
| 391 | + | |
324 | 392 |
| |
325 |
| - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
326 | 400 |
| |
327 | 401 |
| |
328 | 402 |
| |
| |||
456 | 530 |
| |
457 | 531 |
| |
458 | 532 |
| |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
463 | 540 |
| |
464 | 541 |
| |
465 | 542 |
| |
| |||
543 | 620 |
| |
544 | 621 |
| |
545 | 622 |
| |
546 |
| - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
547 | 627 |
|
You can’t perform that action at this time.
0 commit comments