Title: NO_PROXY=example.com does not bypass subdomains for http.request(), unlike fetch() · Issue #65616 · nodejs/node · GitHub
Open Graph Title: NO_PROXY=example.com does not bypass subdomains for http.request(), unlike fetch() · Issue #65616 · nodejs/node
X Title: NO_PROXY=example.com does not bypass subdomains for http.request(), unlike fetch() · Issue #65616 · nodejs/node
Description: Version v24.18.1, also on main (v27.0.0-pre) Platform Darwin xxx.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000 arm64 Subsystem http What steps will reproduce the bug? D...
Open Graph Description: Version v24.18.1, also on main (v27.0.0-pre) Platform Darwin xxx.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000 arm64 Subsystem h...
X Description: Version v24.18.1, also on main (v27.0.0-pre) Platform Darwin xxx.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000 arm64 Subsystem h...
Opengraph URL: https://github.com/nodejs/node/issues/65616
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NO_PROXY=example.com does not bypass subdomains for http.request(), unlike fetch()","articleBody":"### Version\n\nv24.18.1, also on main (v27.0.0-pre)\n\n### Platform\n\n```text\nDarwin xxx.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000 arm64\n```\n\n### Subsystem\n\nhttp\n\n### What steps will reproduce the bug?\n\nDead proxy on port 1 — the error code shows where the request went:\n\n```\nNODE_USE_ENV_PROXY=1 HTTP_PROXY=http://127.0.0.1:1 NO_PROXY=example.com node repro.js\n```\n\n```js\nconst http = require('node:http');\n\nhttp.get('http://internal.example.com/').on('error', (e) => console.log(e.cause?.code ?? e.code));\n// ECONNREFUSED — went through the proxy\n\nfetch('http://internal.example.com/').catch((e) => console.log(e.cause?.code ?? e.code));\n// ENOTFOUND — bypassed, hit DNS\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways, when the `NO_PROXY` entry has no leading dot and the request host is a subdomain of that entry.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nSame `NO_PROXY` in the same process should mean the same thing for `http.request()` / `http.get()` and `fetch()`. `http.setGlobalProxyFromEnv()` and the docs present one `NO_PROXY` format for both.\n\n`fetch()` (undici `EnvHttpProxyAgent`) already treats a plain `example.com` as the host and its subdomains, with a label boundary so `notexample.com` does not match. `http` should do the same.\n\n### What do you see instead?\n\n`ProxyConfig#shouldUseProxy` exact-matches a plain entry against the hostname. `NO_PROXY=example.com` therefore does not bypass `internal.example.com` for `http.request()`, while `fetch()` does.\n\nThe docs currently describe this as “Exact host name match”, which matches the `http` implementation and not `fetch()`.\n\n### Additional information\n\nRefs: #57872, #62907","author":{"url":"https://github.com/dibenkobit","@type":"Person","name":"dibenkobit"},"datePublished":"2026-08-28T12:20:38Z","url":"https://github.com/nodejs/node/issues/65616"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:22be77b7-88d4-144b-e495-263cc3d56cad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC6C:1CAA92:66E7EB:858494:6AED2CDF |
| html-safe-nonce | 43f785e9ffd6b0622a967afdbaf416606d6119a7f716f8b4d4aa3224dbdc7077 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzZDOjFDQUE5Mjo2NkU3RUI6ODU4NDk0OjZBRUQyQ0RGIiwidmlzaXRvcl9pZCI6Ijc3MzI4NDYwNzcxNDM3NTU5OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81d7a39d59874bb14ffc66a6fa7753a4a50aa92417eadc9d3d205c73c35dba98 |
| hovercard-subject-tag | issue:5278144892 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65616/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3a8203c5e1ed8ae31ec1be8278b1ef7dfead2cce30851b44336f4e640e1f8d1/nodejs/node/issues/65616 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3a8203c5e1ed8ae31ec1be8278b1ef7dfead2cce30851b44336f4e640e1f8d1/nodejs/node/issues/65616 |
| og:image:alt | Version v24.18.1, also on main (v27.0.0-pre) Platform Darwin xxx.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000 arm64 Subsystem h... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dibenkobit |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width