Configuring HTTP proxy as described in our docs no longer works in Node@18 and @20
I maintainer di solito rispondono entro 1 giorno
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
- 836
- Fork
- 241
- Merge medio
- 1g 12h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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
-
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the queryForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
microsoftgraph/msgraph-sdk-javascript#2039 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoftgraph/msgraph-sdk-javascript#2011 ·
I maintainer di solito rispondono entro 1 giorno
-
status:waiting-for-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
microsoftgraph/msgraph-sdk-javascript#1956 ·
I maintainer di solito rispondono entro 1 giorno
-
Is anyone here?Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
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
microsoftgraph/msgraph-sdk-javascript#2004 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoftgraph/msgraph-sdk-javascript
Issue simili
-
parity: scripting.net's net-http row fails on macOS with errno 61 where the BDS golden has 111ApertaBug Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JSPrismarine/JSPrismarine#3384 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
zingolabs/zingo-mobile#1951 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Automattic/data-liberation-agent#2175 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
xdelmo/Portfolio-minimal#613 ·
I maintainer di solito rispondono entro 1 giorno
-
backend documentation low-priority Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Savitura/Savitools#611 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni