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
parent
commit
8156e4057b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      apps/api/src/main.ts
  3. 7
      package-lock.json
  4. 1
      package.json

1
CHANGELOG.md

@ -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

4
apps/api/src/main.ts

@ -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[];

7
package-lock.json

@ -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,

1
package.json

@ -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"
},

Loading…
Cancel
Save