Class PacProxyAgent<Uri>

The PacProxyAgent class.

A few different "protocol" modes are supported (supported protocols are backed by the get-uri module):

  • "pac+data", "data" - refers to an embedded "data:" URI
  • "pac+file", "file" - refers to a local file
  • "pac+ftp", "ftp" - refers to a file located on an FTP server
  • "pac+http", "http" - refers to an HTTP endpoint
  • "pac+https", "https" - refers to an HTTPS endpoint

Type Parameters

  • Uri extends string

Hierarchy

Constructors

Properties

cache?: Readable
freeSockets: ReadOnlyDict<Socket[]>
keepAlive: boolean
maxFreeSockets: number
maxSockets: number
maxTotalSockets: number
options: Partial<TcpNetConnectOpts & ConnectionOptions>
requests: ReadOnlyDict<IncomingMessage[]>
resolver?: ((url, _host?) => Promise<string>)

Type declaration

    • (url, _host?): Promise<string>
    • Returns an asynchronous FindProxyForURL() function from the given JS string (from a PAC file).

      Parameters

      • url: string | URL
      • Optional _host: string

      Returns Promise<string>

resolverHash: string
resolverPromise?: Promise<((url, _host?) => Promise<string>)>

Type declaration

    • (url, _host?): Promise<string>
    • Returns an asynchronous FindProxyForURL() function from the given JS string (from a PAC file).

      Parameters

      • url: string | URL
      • Optional _host: string

      Returns Promise<string>

sockets: ReadOnlyDict<Socket[]>
uri: URL
captureRejectionSymbol: typeof captureRejectionSymbol
captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

defaultMaxListeners: number
errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

protocols: ("pac+data" | "pac+file" | "pac+ftp" | "pac+http" | "pac+https")[] = ...

Accessors

  • get defaultPort(): number
  • Returns number

  • set defaultPort(v): void
  • Parameters

    • v: number

    Returns void

  • get protocol(): string
  • Returns string

  • set protocol(v): void
  • Parameters

    • v: string

    Returns void

Methods

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Returns void

  • Called when the node-core HTTP client library is creating a new HTTP request.

    Parameters

    Returns Promise<Agent | Socket>

  • Returns Duplex

  • Parameters

    • req: ClientRequest
    • options: AgentConnectOpts
    • cb: ((err, s?) => void)
        • (err, s?): void
        • Parameters

          • err: null | Error
          • Optional s: Duplex

          Returns void

    Returns void

  • Destroy any sockets that are currently in use by the agent. It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, sockets may hang open for quite a long time before the server terminates them.

    Returns void

  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Returns (string | symbol)[]

  • Returns number

  • Loads the PAC proxy file from the source if necessary, and returns a generated FindProxyForURL() resolver function to use.

    Returns Promise<((url, _host?) => Promise<string>)>

    Api

    private

  • Determine whether this is an http or https request.

    Parameters

    Returns boolean

  • Parameters

    • event: string | symbol

    Returns number

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Loads the contents of the PAC proxy file.

    Returns Promise<string>

    Api

    private

  • Returns Promise<((url, _host?) => Promise<string>)>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Parameters

    • Optional event: string | symbol

    Returns PacProxyAgent<Uri>

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns PacProxyAgent<Uri>

  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

    Deprecated

    since v4.0.0

  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc