googleapis / googleapis/google-api-nodejs-client
add options.proxy support, not only env.HTTP_PROXY
- Vorherrschende Sprache
- TypeScript
- Sterne
- 12.2k
- Forks
- 2k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
**Is your feature request related to a problem? Please describe.**
I want to add a proxy for request from `googleapis`. But `env.HTTP_PROXY` will affect requests from other request client(not only gaxios).And not every other request client support `env.NO_PROXY`.
By reading docs and code of `gaxios`, I thought `options.agent` would be a solution for proxy.
``` typescript
import { google } from 'googleapis';
google.options({
...google._options,
agent: new HttpsProxyAgent(proxy),
});
```
But it looks no effect on oauth2 part. I added some debug code in gaxios to print `opts.agent`:
**Describe the solution you'd like**
I think `google.options({proxy: 'xxx'}` will be better.
**Describe alternatives you've considered**
Like what I mentioned above, I tried `opts.agent`.
**Additional context**
My [issue](https://github.com/googleapis/gaxios/issues/520) in `gaxios`
Beitragsleitfaden
Rechercherichtung
Beginne damit, die google.options-Konfiguration bis zum oauth2-Anfragepfad nachzuverfolgen und sie damit zu vergleichen, wie gaxios options.agent und env.HTTP_PROXY handhabt. Lege fest, wie eine Proxy-Option OAuth-Anfragen erreichen soll, ohne nicht betroffene Request-Clients zu beeinflussen, und überprüfe anschließend das Verhalten über die betroffenen Request-Pfade hinweg sowie den verknüpften gaxios-Kontext.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- node.js, typescript
- Bereich
- api, authentication
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100