• Version 7.0.4
  • Published
  • 35.3 kB
  • 2 dependencies
  • MIT license


npm i https-proxy-agent
yarn add https-proxy-agent
pnpm add https-proxy-agent


An HTTP(s) proxy `http.Agent` implementation for HTTPS



class HttpsProxyAgent

class HttpsProxyAgent<Uri extends string> extends Agent {}
  • The HttpsProxyAgent implements an HTTP Agent subclass that connects to the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.

    Outgoing HTTP requests are first tunneled through the proxy server using the CONNECT HTTP request method to establish a connection to the proxy server, and then the proxy server connects to the destination target and issues the HTTP request from the proxy server.

    https: requests have their socket connection upgraded to TLS once the connection to the proxy server has been established.


constructor(proxy: any, opts?: any);

    property connectOpts

    connectOpts: any;

      property protocols

      static protocols: readonly ['http', 'https'];

        property proxy

        readonly proxy: URL;

          property proxyHeaders

          proxyHeaders: any;

            method connect

            connect: (
            req: http.ClientRequest,
            opts: AgentConnectOpts
            ) => Promise<net.Socket>;
            • Called when the node-core HTTP client library is creating a new HTTP request.

            Type Aliases

            type HttpsProxyAgentOptions

            type HttpsProxyAgentOptions<T> = ConnectOpts<T> &
            http.AgentOptions & {
            headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);

              Package Files (1)

              Dependencies (2)

              Dev Dependencies (11)

              Peer Dependencies (0)

              No peer dependencies.


              To add a badge like this badgeto your package's README, use the codes available below.

              You may also use to create a custom badge linking to

              • Markdown
              • HTML
                <a href=""><img src="" alt=""></a>