agent-base

  • Version 7.1.1
  • Published
  • 31.2 kB
  • 1 dependency
  • MIT license

Install

npm i agent-base
yarn add agent-base
pnpm add agent-base

Overview

Turn a function into an `http.Agent` instance

Index

Variables

variable INTERNAL

const INTERNAL: Symbol;

    Functions

    function json

    json: (stream: Readable) => Promise<any>;

      function req

      req: (url: string | URL, opts?: https.RequestOptions) => ThenableRequest;

        function toBuffer

        toBuffer: (stream: Readable) => Promise<Buffer>;

          Classes

          class Agent

          abstract class Agent extends http.Agent {}

            constructor

            constructor(opts?: http.AgentOptions);

              property defaultPort

              defaultPort: number;

                property keepAlive

                keepAlive: boolean;

                  property options

                  options: Partial<any>;

                    property protocol

                    protocol: string;

                      method connect

                      abstract connect: (
                      req: http.ClientRequest,
                      options: AgentConnectOpts
                      ) => Promise<Duplex | http.Agent> | Duplex | http.Agent;

                        method createConnection

                        createConnection: () => Duplex;

                          method createSocket

                          createSocket: (
                          req: http.ClientRequest,
                          options: AgentConnectOpts,
                          cb: (err: Error | null, s?: Duplex) => void
                          ) => void;

                            method getName

                            getName: (options: AgentConnectOpts) => string;

                              method isSecureEndpoint

                              isSecureEndpoint: (options?: AgentConnectOpts) => boolean;
                              • Determine whether this is an http or https request.

                              Type Aliases

                              type AgentConnectOpts

                              type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;

                                type ThenableRequest

                                type ThenableRequest = http.ClientRequest & {
                                then: Promise<http.IncomingMessage>['then'];
                                };

                                  Package Files (2)

                                  Dependencies (1)

                                  Dev Dependencies (11)

                                  Peer Dependencies (0)

                                  No peer dependencies.

                                  Badge

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

                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/agent-base.

                                  • Markdown
                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/agent-base)
                                  • HTML
                                    <a href="https://www.jsdocs.io/package/agent-base"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>