diff --git a/packages/node/src/transport/http.ts b/packages/node/src/transport/http.ts index 468bb6d..a0dc2ba 100644 --- a/packages/node/src/transport/http.ts +++ b/packages/node/src/transport/http.ts @@ -46,9 +46,13 @@ export class FetchHttpClient implements HttpClient { method: method, headers: headers, body: body, - agent: this.httpAgent, timeout: timeoutMillis, }; + + if (urlParams.protocol === 'https:') { + options['agent'] = this.httpAgent; + } + const protocol = urlParams.protocol === 'http:' ? http : https; const req = protocol.request(options);