From a0bd3b602f8cfb57d950aec9ed29549e42906a24 Mon Sep 17 00:00:00 2001 From: Brian Giori Date: Wed, 28 Feb 2024 20:19:01 -0800 Subject: [PATCH] fix: support http serverUrl --- packages/node/src/transport/http.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);