Fix Agent type, httpでもDNSキャッシュ (#7520)
This commit is contained in:
parent
7dc85a624e
commit
961b3177d5
|
@ -55,7 +55,8 @@ export async function getHtml(url: string, accept = 'text/html, */*', timeout =
|
||||||
const _http = new http.Agent({
|
const _http = new http.Agent({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
keepAliveMsecs: 30 * 1000,
|
keepAliveMsecs: 30 * 1000,
|
||||||
});
|
lookup: cache.lookup,
|
||||||
|
} as http.AgentOptions);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get https non-proxy agent
|
* Get https non-proxy agent
|
||||||
|
@ -70,14 +71,14 @@ const _https = new https.Agent({
|
||||||
* Get http proxy or non-proxy agent
|
* Get http proxy or non-proxy agent
|
||||||
*/
|
*/
|
||||||
export const httpAgent = config.proxy
|
export const httpAgent = config.proxy
|
||||||
? new HttpProxyAgent(config.proxy) as unknown as http.Agent
|
? new HttpProxyAgent(config.proxy)
|
||||||
: _http;
|
: _http;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get https proxy or non-proxy agent
|
* Get https proxy or non-proxy agent
|
||||||
*/
|
*/
|
||||||
export const httpsAgent = config.proxy
|
export const httpsAgent = config.proxy
|
||||||
? new HttpsProxyAgent(config.proxy) as unknown as https.Agent
|
? new HttpsProxyAgent(config.proxy)
|
||||||
: _https;
|
: _https;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue