提交 e7f25412 编写于 作者: C Christof Marti

Update https-proxy-agent (#83647)

上级 d4df127b
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'https-proxy-agent' {
import * as tls from 'tls';
interface IHttpsProxyAgentOptions extends tls.ConnectionOptions {
host: string;
port: number;
auth?: string;
secureProxy?: boolean;
secureEndpoint?: boolean;
}
class HttpsProxyAgent {
constructor(proxy: string);
constructor(opts: IHttpsProxyAgentOptions);
}
export = HttpsProxyAgent;
}
\ No newline at end of file
......@@ -44,9 +44,7 @@ export async function getProxyAgent(rawRequestURL: string, options: IOptions = {
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true
};
const Ctor = requestURL.protocol === 'http:'
? await import('http-proxy-agent')
: await import('https-proxy-agent');
return new Ctor(opts);
return requestURL.protocol === 'http:'
? new (await import('http-proxy-agent'))(opts)
: new (await import('https-proxy-agent'))(opts);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册