chore: enable keepAlive in happy eyeballs http.Agent

This commit is contained in:
Max Schmitt 2024-06-25 12:51:56 +02:00
parent a6b6b243d0
commit 36b85c7af4

View file

@ -45,8 +45,9 @@ class HttpsHappyEyeballsAgent extends https.Agent {
}
}
export const httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent();
export const httpHappyEyeballsAgent = new HttpHappyEyeballsAgent();
// These options are aligned with the default Node.js globalAgent options.
export const httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 });
export const httpHappyEyeballsAgent = new HttpHappyEyeballsAgent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 });
export async function createSocket(host: string, port: number): Promise<net.Socket> {
return new Promise((resolve, reject) => {