Support Happy Eyeballs in proxy-agent

This commit is contained in:
Fedor Indutny 2023-08-30 01:58:48 +02:00 committed by GitHub
parent eae9e570fc
commit 56ba8fea4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 419 additions and 289 deletions

View file

@ -1,7 +1,6 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type ProxyAgent from 'proxy-agent';
import { client as WebSocketClient } from 'websocket';
import type { connection as WebSocket } from 'websocket';
@ -10,6 +9,7 @@ import { strictAssert } from '../util/assert';
import { explodePromise } from '../util/explodePromise';
import { getUserAgent } from '../util/getUserAgent';
import * as durations from '../util/durations';
import type { createProxyAgent } from '../util/createProxyAgent';
import { createHTTPSAgent } from '../util/createHTTPSAgent';
import * as log from '../logging/log';
import * as Timers from '../Timers';
@ -28,7 +28,7 @@ export type ConnectOptionsType<Resource extends IResource> = Readonly<{
url: string;
certificateAuthority?: string;
version: string;
proxyAgent?: ReturnType<typeof ProxyAgent>;
proxyAgent?: ReturnType<typeof createProxyAgent>;
timeout?: number;
extraHeaders?: Record<string, string>;