feat: cli -- system level proxy fix

This commit is contained in:
lohxt1
2024-12-12 14:09:06 +05:30
parent 57d86eb118
commit a55ed9bd50
3 changed files with 90 additions and 32 deletions

View File

@@ -10,6 +10,7 @@ const { CLI_VERSION } = require('../constants');
function makeAxiosInstance() {
/** @type {axios.AxiosInstance} */
const instance = axios.create({
proxy: false,
headers: {
"User-Agent": `bruno-runtime/${CLI_VERSION}`
}

View File

@@ -79,7 +79,18 @@ class PatchedHttpsProxyAgent extends HttpsProxyAgent {
}
}
const getSystemProxyEnvVariables = () => {
const { http_proxy, HTTP_PROXY, https_proxy, HTTPS_PROXY, no_proxy, NO_PROXY } = process.env;
return {
http_proxy: http_proxy || HTTP_PROXY,
https_proxy: https_proxy || HTTPS_PROXY,
no_proxy: no_proxy || NO_PROXY
};
}
module.exports = {
shouldUseProxy,
PatchedHttpsProxyAgent
PatchedHttpsProxyAgent,
getSystemProxyEnvVariables
};