Configuring HTTP proxy as described in our docs no longer works in Node@18 and @20
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- api, networking
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 836
- Fork
- 241
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-javascript
-
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the queryCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
microsoftgraph/msgraph-sdk-javascript#2039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoftgraph/msgraph-sdk-javascript#2011 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
microsoftgraph/msgraph-sdk-javascript#1956 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Is anyone here?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests?Đang mởstatus:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
microsoftgraph/msgraph-sdk-javascript#2004 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoftgraph/msgraph-sdk-javascript
Issue tương tự
-
parity: scripting.net's net-http row fails on macOS with errno 61 where the BDS golden has 111Đang mởBug Tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
JSPrismarine/JSPrismarine#3384 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zingolabs/zingo-mobile#1951 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Automattic/data-liberation-agent#2175 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
xdelmo/Portfolio-minimal#613 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend documentation low-priority Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Savitura/Savitools#611 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày