Skip to content

Commit 5d9d700

Browse files
committed
chore: add Node.js-specific notes for https agent usage in BaseRestClient and update import type in WebSocket client
1 parent ce89c31 commit 5d9d700

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/lib/BaseRestClient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import axios, { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
2+
// NOTE: https.Agent is Node.js-only and not available in browser environments
3+
// Browser builds (via webpack) exclude this module - see webpack.config.js fallback settings
24
import https from 'https';
35

46
import { neverGuard } from './misc-util.js';
@@ -166,6 +168,9 @@ export abstract class BaseRestClient {
166168
};
167169

168170
// If enabled, configure a https agent with keepAlive enabled
171+
// NOTE: This is Node.js-only functionality. In browser environments, this code is skipped
172+
// as the 'https' module is excluded via webpack fallback configuration.
173+
// Browser connection pooling is handled automatically by the browser itself.
169174
if (this.options.keepAlive) {
170175
// Extract existing https agent parameters, if provided, to prevent the keepAlive flag from overwriting an existing https agent completely
171176
const existingHttpsAgent = this.globalRequestOptions.httpsAgent as

src/types/websockets/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ClientRequestArgs } from 'http';
1+
import type { ClientRequestArgs } from 'http';
22
import WebSocket from 'isomorphic-ws';
33

44
/**

0 commit comments

Comments
 (0)