@@ -32,25 +32,17 @@ let proxyConfig: ProxyConfig;
3232
3333function createAxiosInstance (
3434 config : ProxyConfig ,
35- enableRQProxy : boolean = false ,
3635 addStoredCookies : boolean = false
3736) : AxiosInstance {
38- let instance : AxiosInstance ;
39- if ( enableRQProxy ) {
40- instance = axios . create ( {
41- proxy : false ,
42- httpAgent : new HttpsProxyAgent ( `http://${ config . ip } :${ config . port } ` ) ,
43- httpsAgent : new PatchedHttpsProxyAgent ( {
44- host : config . ip ,
45- port : config . port ,
46- ca : readFileSync ( config . rootCertPath ) ,
47- } ) ,
48- } ) ;
49- } else {
50- instance = axios . create ( {
51- proxy : false ,
52- } ) ;
53- }
37+ const instance = axios . create ( {
38+ proxy : false ,
39+ httpAgent : new HttpsProxyAgent ( `http://${ config . ip } :${ config . port } ` ) ,
40+ httpsAgent : new PatchedHttpsProxyAgent ( {
41+ host : config . ip ,
42+ port : config . port ,
43+ ca : readFileSync ( config . rootCertPath ) ,
44+ } ) ,
45+ } ) ;
5446
5547 instance . interceptors . response . use ( storeCookiesFromResponse ) ;
5648 if ( addStoredCookies ) {
@@ -68,8 +60,8 @@ export const createOrUpdateAxiosInstance = (
6860 } ;
6961
7062 try {
71- proxiedAxios = createAxiosInstance ( proxyConfig , false ) ;
72- proxiedAxiosWithSessionCookies = createAxiosInstance ( proxyConfig , false , true ) ;
63+ proxiedAxios = createAxiosInstance ( proxyConfig ) ;
64+ proxiedAxiosWithSessionCookies = createAxiosInstance ( proxyConfig , true ) ;
7365 } catch ( error ) {
7466 /* Do nothing */
7567 console . error ( "Error creating or updating Axios instance:" , error ) ;
0 commit comments