Update "Use Dev Proxy with Node.js" for native `fetch` proxy support and certificate trust

未关闭
#2,084 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@waldekmastykarz 已经在做这个了。

开始于 2026年11月5日。

评估

这个 Issue 还没有评估数据。

描述

documentation work in progress

Problem

The Node.js page states that native fetch "doesn't support configuring a proxy", and recommends NODE_TLS_REJECT_UNAUTHORIZED=0 for certificate errors. Both are outdated:

  • Node.js 24+ (and 22.21+) routes fetch and http(s) through HTTP(S)_PROXY when NODE_USE_ENV_PROXY=1 or --use-env-proxy is set.
  • NODE_EXTRA_CA_CERTS with the Dev Proxy root certificate is the safe alternative to disabling TLS verification. The certificate can be fetched with GET /proxy/rootCertificate?format=crt.

In all five evaluated runs, the agent worked this out from model knowledge rather than the docs. An agent that followed the page would disable TLS validation, or conclude that native fetch can't be proxied.

Proposal

  • Rewrite the "Native Node.js fetch API" section around NODE_USE_ENV_PROXY, including the version floor.
  • Replace NODE_TLS_REJECT_UNAUTHORIZED=0 with NODE_EXTRA_CA_CERTS, showing how to obtain the certificate through the API or CLI.
  • For older Node versions, keep the fallbacks: undici EnvHttpProxyAgent or global-agent.

Found while evaluating how coding agents use Dev Proxy: VS Code + GitHub Copilot Chat with Claude Sonnet 5.5, Dev Proxy 4.0.0 on Windows, 5 runs of the task "add a CI script that starts Dev Proxy in the background, starts and stops recording through the API around npm start, and shuts Dev Proxy down through the API".

主要语言
C#
星标
841
派生
90
平均合并
2 天 10 小时
30 天内合并 PR
63

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dotnet/dev-proxy 的其他 Issue

查看 dotnet/dev-proxy 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。