Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/common/http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { injector } from "./yok";
import axios from "axios";
import { HttpStatusCodes } from "./constants";
import * as tunnel from "tunnel";
import { Agent } from "http";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Agent } from "http";


export class HttpClient implements Server.IHttpClient {
private static STUCK_REQUEST_ERROR_MESSAGE =
Expand Down Expand Up @@ -98,12 +99,15 @@ export class HttpClient implements Server.IHttpClient {

this.$logger.trace("httpRequest: %s", util.inspect(options));

const agent = tunnel.httpsOverHttp({
proxy: {
host: cliProxySettings.hostname,
port: parseInt(cliProxySettings.port),
},
});
const agent = cliProxySettings
? tunnel.httpsOverHttp({
proxy: {
host: cliProxySettings.hostname,
port: parseInt(cliProxySettings.port),
},
})
: new Agent({ keepAlive: true }); // If no proxy use default.

const result = await axios({
url: options.url,
headers: options.headers,
Expand Down
2 changes: 1 addition & 1 deletion lib/services/test-execution-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class TestExecutionService implements ITestExecutionService {
liveSyncInfo.projectDir,
TestExecutionService.SOCKETIO_JS_FILE_NAME
),
socketIoJs
JSON.parse(socketIoJs)
);
}

Expand Down