Skip to content

Commit fc30d6f

Browse files
Chore: Adding Proxy for ATSHelper
1 parent b5550d7 commit fc30d6f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

bin/helpers/atsHelper.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22
const fs = require('fs');
33
const { consoleHolder } = require('../testObservability/helper/constants');
4+
const HttpsProxyAgent = require('https-proxy-agent');
45

56
const axios = require('axios'),
67
logger = require('./logger').winstonLogger,
@@ -57,7 +58,15 @@ exports.getTurboScaleGridDetails = async (bsConfig, args, rawArgs) => {
5758
'User-Agent': utils.getUserAgent(),
5859
}
5960
};
61+
62+
if(process.env.HTTP_PROXY){
63+
options.httpsAgent = new HttpsProxyAgent(process.env.HTTP_PROXY);
64+
} else if (process.env.HTTPS_PROXY){
65+
options.httpsAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
66+
}
67+
6068
let responseData = {};
69+
6170
axios(options).then(response => {
6271
consoleHolder.log("Resp1->", response);
6372
try {

bin/testObservability/crashReporter/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class CrashReporter {
158158

159159
if(process.env.HTTP_PROXY){
160160
options.httpsAgent = new HttpsProxyAgent(process.env.HTTP_PROXY);
161-
162161
} else if (process.env.HTTPS_PROXY){
163162
options.httpsAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
164163
}

bin/testObservability/helper/helper.js

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ const nodeRequest = (type, url, data, config) => {
135135

136136
if(process.env.HTTP_PROXY){
137137
options.httpsAgent = new HttpsProxyAgent(process.env.HTTP_PROXY);
138-
139138
} else if (process.env.HTTPS_PROXY){
140139
options.httpsAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
141140
}

0 commit comments

Comments
 (0)