Configuring HTTP proxy as described in our docs no longer works in Node@18 and @20
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- node.js, typescript
- Ambito
- api, networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 833
- Fork
- 240
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
-
Is anyone here? Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reazione ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Apertastatus:waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
-
status:waiting-for-triage type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 commenti · 1 reazione ·
-
status:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di microsoftgraph/msgraph-sdk-javascript
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Add: Star Sports 2 Telugu HD Apertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100