Hierarchy

Constructors

Properties

freeSockets: ReadOnlyDict<Socket[]>
keepAlive: boolean
maxFreeSockets: number
maxSockets: number
maxTotalSockets: number
options: Partial<TcpNetConnectOpts & ConnectionOptions>
proxy: SocksProxy
requests: ReadOnlyDict<IncomingMessage[]>
shouldLookup: boolean
sockets: ReadOnlyDict<Socket[]>
timeout: null | number
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: readonly ["socks", "socks4", "socks4a", "socks5", "socks5h"] = ...

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 SocksProxyAgent

  • Initiates a SOCKS connection to the specified SOCKS proxy server, which in turn connects to the specified remote host and port.

    Parameters

    Returns Promise<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

  • Determine whether this is an http or https request.

    Parameters

    Returns boolean

  • Parameters

    • event: string | symbol

    Returns number

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns SocksProxyAgent

  • 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