![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/self/root/usr/local/lib/node_modules/npm/node_modules/agent-base/dist/src/ |
Upload File : |
/// <reference types="node" /> import net from 'net'; import http from 'http'; import https from 'https'; import { Duplex } from 'stream'; import { EventEmitter } from 'events'; declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; declare namespace createAgent { interface ClientRequest extends http.ClientRequest { _last?: boolean; _hadError?: boolean; method: string; } interface AgentRequestOptions { host?: string; path?: string; port: number; } interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> { secureEndpoint: false; } interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> { secureEndpoint: true; } type RequestOptions = HttpRequestOptions | HttpsRequestOptions; type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent; type AgentCallbackReturn = Duplex | AgentLike; type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>; type AgentCallback = typeof Agent.prototype.callback; type AgentOptions = { timeout?: number; }; /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends EventEmitter { timeout: number | null; maxFreeSockets: number; maxTotalSockets: number; maxSockets: number; sockets: { [key: string]: net.Socket[]; }; freeSockets: { [key: string]: net.Socket[]; }; requests: { [key: string]: http.IncomingMessage[]; }; options: https.AgentOptions; private promisifiedCallback?; private explicitDefaultPort?; private explicitProtocol?; constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); get defaultPort(): number; set defaultPort(v: number); get protocol(): string; set protocol(v: string); callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>; /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req: ClientRequest, _opts: RequestOptions): void; freeSocket(socket: net.Socket, opts: AgentOptions): void; destroy(): void; } } export = createAgent;