diff --git a/lib/config.js b/lib/config.js index 2f82d9b..20c3874 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,10 +1,14 @@ -var httpTunnelConfigPath = 'https://downloads.lambdatest.com/tunnel/node-tunnel-config-v3-latest.json', +var prodTunnelConfigPath = 'https://downloads.lambdatest.com/tunnel/node-tunnel-config-v3-latest.json', + stageTunnelConfigPath = 'https://stage-downloads.lambdatestinternal.com/tunnel/node-tunnel-config-v3-latest.json', httpTunnelLogUrl = 'https://oinwgsy681.execute-api.us-east-1.amazonaws.com/prod/addLog', https = require('https'), urlParse = require('url'), HttpsProxyAgent = require('https-proxy-agent'), util = require('./util'); module.exports = function(options, fnCallback) { + // stage env resolves config (and thus AuthUrl + binaryLinks) to stage + var env = String(options.env || options.environment || options.e || 'prod').toLowerCase(); + var httpTunnelConfigPath = env === 'stage' ? stageTunnelConfigPath : prodTunnelConfigPath; var reqOptions = urlParse.parse(httpTunnelConfigPath); var proxyOpts = util.getProxyOpts_(options); if (Object.keys(proxyOpts).length) {