From 496a43e02bee98d334d260ac4e35af9eddff57f3 Mon Sep 17 00:00:00 2001 From: Lerr1uqs <624299960@qq.com> Date: Sat, 8 Nov 2025 20:13:05 +0800 Subject: [PATCH] fix the problem that axios don't use the http proxy #21199 --- .../utils/request-helper-functions.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts b/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts index 41d7134ee9a..8b1127d65f0 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts @@ -268,6 +268,16 @@ export async function invokeAxios( axiosConfig: AxiosRequestConfig, authOptions: IRequestOptions['auth'] = {}, ) { + // axios not apply the http.globalAgent, need set it manually + const url = process.env.HTTP_PROXY ?? process.env.HTTPS_PROXY ?? process.env.ALL_PROXY; + if (url) { + const parsedUrl = new URL(url); + axiosConfig.proxy = { + host: parsedUrl.hostname, + port: parseInt(parsedUrl.port) || (parsedUrl.protocol === 'https:' ? 443 : 80), + protocol: parsedUrl.protocol.replace(':', ''), + }; + } try { return await axios(axiosConfig); } catch (error) {