Skip to content

Commit

Permalink
feat: add max connections
Browse files Browse the repository at this point in the history
  • Loading branch information
lusyn committed Dec 11, 2023
1 parent 0d9f662 commit 83624a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/HttpAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
import type Dispatcher from 'undici/types/dispatcher';
import type buildConnector from 'undici/types/connector';

const MAX_CONNECTIONS = 1000;

export type CheckAddressFunction = (ip: string, family: number | string) => boolean;

export type HttpAgentOptions = {
Expand Down Expand Up @@ -60,6 +62,7 @@ export class HttpAgent extends Agent {
};
super({
connect: { ...options.connect, lookup },
connections: MAX_CONNECTIONS,
});
this.#checkAddress = options.checkAddress;
}
Expand Down

0 comments on commit 83624a2

Please sign in to comment.