Browse Source
Task/respect HTTP_PROXY environment variables for outbound HTTP requests (#6952)
* Respect HTTP proxy environment variables for outbound HTTP requests
* Update changelog
pull/6956/head
Thomas Kaul
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
10 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/main.ts
-
package-lock.json
-
package.json
|
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
- Added `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variable support to outbound HTTP requests |
|
|
|
- Added the `FetchService` to centralize outbound HTTP requests |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -18,11 +18,15 @@ import type { NestExpressApplication } from '@nestjs/platform-express'; |
|
|
|
import cookieParser from 'cookie-parser'; |
|
|
|
import { NextFunction, Request, Response } from 'express'; |
|
|
|
import helmet from 'helmet'; |
|
|
|
import { EnvHttpProxyAgent, setGlobalDispatcher } from 'undici'; |
|
|
|
|
|
|
|
import { AppModule } from './app/app.module'; |
|
|
|
import { environment } from './environments/environment'; |
|
|
|
|
|
|
|
async function bootstrap() { |
|
|
|
// Respect HTTP_PROXY / HTTPS_PROXY / NO_PROXY for outbound HTTP requests
|
|
|
|
setGlobalDispatcher(new EnvHttpProxyAgent()); |
|
|
|
|
|
|
|
const configApp = await NestFactory.create(AppModule); |
|
|
|
const configService = configApp.get<ConfigService>(ConfigService); |
|
|
|
let customLogLevels: LogLevel[]; |
|
|
|
|
|
|
|
@ -94,6 +94,7 @@ |
|
|
|
"svgmap": "2.19.3", |
|
|
|
"tablemark": "4.1.0", |
|
|
|
"twitter-api-v2": "1.29.0", |
|
|
|
"undici": "7.24.4", |
|
|
|
"yahoo-finance2": "3.14.2", |
|
|
|
"zone.js": "0.16.1" |
|
|
|
}, |
|
|
|
@ -28576,9 +28577,9 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
"node_modules/jsdom/node_modules/undici": { |
|
|
|
"version": "7.24.7", |
|
|
|
"resolved": "https://registry.npmjs.org/undici/-/undici-7.24.7.tgz", |
|
|
|
"integrity": "sha512-H/nlJ/h0ggGC+uRL3ovD+G0i4bqhvsDOpbDv7At5eFLlj2b41L8QliGbnl2H7SnDiYhENphh1tQFJZf+MyfLsQ==", |
|
|
|
"version": "7.26.0", |
|
|
|
"resolved": "https://registry.npmjs.org/undici/-/undici-7.26.0.tgz", |
|
|
|
"integrity": "sha512-3O9Tf67pGhgOv9jM35AbhkXAKi13f3oy3aE4CSgr+TckGeY+/iu97ZXN+J7DpHPzLbVApFd1IFhcnBjREYXYcg==", |
|
|
|
"dev": true, |
|
|
|
"license": "MIT", |
|
|
|
"peer": true, |
|
|
|
|
|
|
|
@ -138,6 +138,7 @@ |
|
|
|
"svgmap": "2.19.3", |
|
|
|
"tablemark": "4.1.0", |
|
|
|
"twitter-api-v2": "1.29.0", |
|
|
|
"undici": "7.24.4", |
|
|
|
"yahoo-finance2": "3.14.2", |
|
|
|
"zone.js": "0.16.1" |
|
|
|
}, |
|
|
|
|