From 9bfa418649a54cd036b53ae195ef6a5de6ab3d62 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Tue, 6 Feb 2024 09:24:48 -0500 Subject: [PATCH] Use agent for proxy configuration --- apps/generator-cli/src/app/app.module.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/generator-cli/src/app/app.module.ts b/apps/generator-cli/src/app/app.module.ts index 2f43f1985..c8e6fba45 100644 --- a/apps/generator-cli/src/app/app.module.ts +++ b/apps/generator-cli/src/app/app.module.ts @@ -5,9 +5,20 @@ import {Command} from 'commander'; import {COMMANDER_PROGRAM, LOGGER} from './constants'; import {VersionManagerController} from './controllers/version-manager.controller'; import {ConfigService, GeneratorService, PassThroughService, UIService, VersionManagerService} from './services'; +import { ProxyAgent } from 'proxy-agent'; + +// The correct proxy `Agent` implementation to use will be determined +// via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars +const agent = new ProxyAgent(); @Module({ - imports: [HttpModule], + imports: [ + HttpModule.register({ + proxy: false, + httpAgent: agent, + httpsAgent: agent + }) + ], controllers: [ VersionManagerController ],