1 /// <reference types="node" /> 2 import net from 'net'; 3 import { Agent, ClientRequest, RequestOptions } from 'agent-base'; 4 import { HttpsProxyAgentOptions } from '.'; 5 /** 6 * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to 7 * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. 8 * 9 * Outgoing HTTP requests are first tunneled through the proxy server using the 10 * `CONNECT` HTTP request method to establish a connection to the proxy server, 11 * and then the proxy server connects to the destination target and issues the 12 * HTTP request from the proxy server. 13 * 14 * `https:` requests have their socket connection upgraded to TLS once 15 * the connection to the proxy server has been established. 16 * 17 * @api public 18 */ 19 export default class HttpsProxyAgent extends Agent { 20 private secureProxy; 21 private proxy; 22 constructor(_opts: string | HttpsProxyAgentOptions); 23 /** 24 * Called when the node-core HTTP client library is creating a 25 * new HTTP request. 26 * 27 * @api protected 28 */ 29 callback(req: ClientRequest, opts: RequestOptions): Promise<net.Socket>; 30 }