diff --git a/packages/client-node/src/connection/node_custom_agent_connection.ts b/packages/client-node/src/connection/node_custom_agent_connection.ts index b1ce7ab..8e27fb9 100644 --- a/packages/client-node/src/connection/node_custom_agent_connection.ts +++ b/packages/client-node/src/connection/node_custom_agent_connection.ts @@ -18,7 +18,7 @@ export class NodeCustomAgentConnection extends NodeBaseConnection { super(params, params.http_agent) // See https://github.com/ClickHouse/clickhouse-js/issues/352 - if (params.http_agent instanceof Https.Agent) { + if (params.url.protocol.startsWith('https')) { this.httpRequestFn = Https.request } else { this.httpRequestFn = Http.request