Configuring HTTP proxy as described in our docs no longer works in Node@18 and @20
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- node.js, typescript
- Domaine
- api, networking
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- TypeScript
- Étoiles
- 836
- Forks
- 241
- Merge moyen
- 1 j 12 h
- PR mergées (30 j)
- 10
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-sdk-javascript
-
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the queryPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
microsoftgraph/msgraph-sdk-javascript#2039 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
microsoftgraph/msgraph-sdk-javascript#2011 ·
Les mainteneurs répondent en général sous 1 jour
-
status:waiting-for-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
microsoftgraph/msgraph-sdk-javascript#1956 ·
Les mainteneurs répondent en général sous 1 jour
-
Is anyone here?Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests?Ouvertestatus:waiting-for-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 42/100
microsoftgraph/msgraph-sdk-javascript#2004 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de microsoftgraph/msgraph-sdk-javascript
Issues similaires
-
[功能请求] 设置选项语言调整Ouverte功能请求
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
antithesishq/bombadil#473 ·
Les mainteneurs répondent en général sous 2 jours
-
The structured output reference promises null results for refusals that carry validation detailsOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
mattermost/mattermost-mobile#10358 ·
Les mainteneurs répondent en général sous 1 jour
-
ready-for-agent
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
LucasSantana-Dev/Lucky#3257 ·
Les mainteneurs répondent en général sous 1 jour