Support Happy Eyeballs in proxy-agent
This commit is contained in:
parent
eae9e570fc
commit
56ba8fea4d
13 changed files with 419 additions and 289 deletions
|
@ -3,13 +3,13 @@
|
|||
|
||||
import type { StrictOptions as GotOptions } from 'got';
|
||||
import config from 'config';
|
||||
import ProxyAgent from 'proxy-agent';
|
||||
import { Agent as HTTPAgent } from 'http';
|
||||
|
||||
import * as packageJson from '../../package.json';
|
||||
import { getUserAgent } from '../util/getUserAgent';
|
||||
import * as durations from '../util/durations';
|
||||
import { createHTTPSAgent } from '../util/createHTTPSAgent';
|
||||
import { createProxyAgent } from '../util/createProxyAgent';
|
||||
|
||||
export const GOT_CONNECT_TIMEOUT = durations.MINUTE;
|
||||
export const GOT_LOOKUP_TIMEOUT = durations.MINUTE;
|
||||
|
@ -29,8 +29,8 @@ export function getGotOptions(): GotOptions {
|
|||
const proxyUrl = getProxyUrl();
|
||||
const agent = proxyUrl
|
||||
? {
|
||||
http: new ProxyAgent(proxyUrl),
|
||||
https: new ProxyAgent(proxyUrl),
|
||||
http: createProxyAgent(proxyUrl),
|
||||
https: createProxyAgent(proxyUrl),
|
||||
}
|
||||
: {
|
||||
http: new HTTPAgent(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue