Skip to content

Commit

Permalink
makinf proxy: false conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithlesh Singh authored and TBonnin committed Jun 26, 2024
1 parent 80275c5 commit 12c3f15
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/utils/lib/axios.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HttpProxyAgent } from 'http-proxy-agent';
import { HttpsProxyAgent } from 'https-proxy-agent';
import type { AxiosRequestConfig } from 'axios';
import axios from 'axios';
import http from 'node:http';
import type { Agent as HttpAgent } from 'node:http';
Expand All @@ -19,8 +20,13 @@ if (hasHttpsProxy) {
httpsAgent = new HttpsProxyAgent(hasHttpsProxy);
}

export const axiosInstance = axios.create({
proxy: false,
const config: AxiosRequestConfig = {
httpAgent: httpAgent,
httpsAgent: httpsAgent
});
};

if (hasHttpProxy || hasHttpsProxy) {
config.proxy = false;
}

export const axiosInstance = axios.create(config);

0 comments on commit 12c3f15

Please sign in to comment.