NO_PROXY=example.com does not bypass subdomains for http.request(), unlike fetch()
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, nodejs
- 領域
- backend, networking
調査の方向性
repro.js の動作と http エントリーポイント ProxyConfig#shouldUseProxy から始め、fetch() の EnvHttpProxyAgent および NO_PROXY のドキュメントと比較してください。単純な example.com エントリがラベル境界に従ってそのサブドメインをバイパスし、http.request() と fetch() の結果が一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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?
Dead proxy on port 1 — the error code shows where the request went:
NODE_USE_ENV_PROXY=1 HTTP_PROXY=http://127.0.0.1:1 NO_PROXY=example.com node repro.js
const http = require('node:http');
http.get('http://internal.example.com/').on('error', (e) => console.log(e.cause?.code ?? e.code));
// ECONNREFUSED — went through the proxy
fetch('http://internal.example.com/').catch((e) => console.log(e.cause?.code ?? e.code));
// ENOTFOUND — bypassed, hit DNS
How often does it reproduce? Is there a required condition?
Always, when the NO_PROXY entry has no leading dot and the request host is a subdomain of that entry.
What is the expected behavior? Why is that the expected behavior?
Same 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.
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.
What do you see instead?
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.
The docs currently describe this as “Exact host name match”, which matches the http implementation and not fetch().
Additional information
Refs: #57872, #62907
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.4k
- 平均マージ
- 4日 4時間
- マージ済み PR(30日)
- 276
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node のほかの issue
-
doc
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
bug customer-eng Durable Agents Inngest status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/OrgExplorer#253 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100