Configuring HTTP proxy as described in our docs no longer works in Node@18 and @20
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- node.js, typescript
- 领域
- api, networking
调研方向
Start at the FetchOptions interface and the Client.initWithMiddleware entry point described in the report, then trace how Node 18/20 fetch options reach requests. Support the undici ProxyAgent dispatcher alongside the documented configuration and verify that requests are intercepted by the specified HTTP proxy.
由索引模型根据 Issue 内容生成。
描述
Bug Report
Description
Since v18, Node ships with a native fetch client. This client requires a different way to specify an HTTP proxy than what we've been supporting in our SDKs so far.
To specify an HTTP proxy for Node's fetch, you need to use the following code (tested on Node v18.19 and v20.11):
import { ProxyAgent } from 'undici';
import { Client } from '@microsoft/microsoft-graph-client';
const dispatcher = new ProxyAgent(process.env.https_proxy);
const fetchOptions = {
dispatcher
};
Client.initWithMiddleware({
middleware,
fetchOptions
});
What's noteworthy:
- we specify HTTP proxy using dispatcher instead of agent (agent is ignored on requests, which makes it hard to debug)
- the ProxyAgent dispatcher comes from undici which seems to be maintained by Node folks. The ProxyAgent is incompatible with other agents that we used to use in the past.
We should update our FetchOptions interface to support specifying dispatcher.
Console Errors: no
Steps to Reproduce
- Configure an http proxy as specified in our docs
Expected behavior: web requests intercepted by the specified proxy
Actual behavior: web requests passed through without being intercepted
Additional Context
Usage Information
SDK Version - 3.06
- Node (Check, if using Node version of SDK)
Node Version - v18.19 and v20.11
- 主要语言
- TypeScript
- 星标
- 836
- 派生
- 241
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-javascript 的其他 Issue
-
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the query可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
microsoftgraph/msgraph-sdk-javascript#2039 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoftgraph/msgraph-sdk-javascript#2011 ·
维护者通常 1 天内回复
-
status:waiting-for-triage
难度 1/5 1 小时以内 新手友好度 62/100
microsoftgraph/msgraph-sdk-javascript#1956 ·
维护者通常 1 天内回复
-
Is anyone here?未关闭
难度 4/5 3-5 天 新手友好度 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 个 reaction ·
维护者通常 1 天内回复
-
status:waiting-for-triage
难度 5/5 一周以上 新手友好度 42/100
microsoftgraph/msgraph-sdk-javascript#2004 ·
维护者通常 1 天内回复
查看 microsoftgraph/msgraph-sdk-javascript 的全部 Issue
相似的 Issue
-
documentation lens:human needs-triage
难度 2/5 1-3 小时 新手友好度 73/100
thebristolsound/birdbrain#2246 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
bug ready-for-human
难度 2/5 1-3 小时 新手友好度 72/100
BoardGamesEmpire/board-games-empire-backend#1452 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue stretch
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复