You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
4 weeks ago
|
declare module "agentkeepalive" {
|
||
|
import * as http from 'http';
|
||
|
import * as https from 'https';
|
||
|
|
||
|
interface AgentStatus {
|
||
|
createSocketCount: number,
|
||
|
createSocketErrorCount: number,
|
||
|
closeSocketCount: number,
|
||
|
errorSocketCount: number,
|
||
|
timeoutSocketCount: number,
|
||
|
requestCount: number,
|
||
|
freeSockets: object,
|
||
|
sockets: object,
|
||
|
requests: object,
|
||
|
}
|
||
|
|
||
|
interface HttpOptions extends http.AgentOptions {
|
||
|
freeSocketKeepAliveTimeout?: number;
|
||
|
timeout?: number;
|
||
|
socketActiveTTL?: number;
|
||
|
}
|
||
|
|
||
|
interface HttpsOptions extends https.AgentOptions {
|
||
|
freeSocketKeepAliveTimeout?: number;
|
||
|
timeout?: number;
|
||
|
socketActiveTTL?: number;
|
||
|
}
|
||
|
|
||
|
class internal extends http.Agent {
|
||
|
constructor(opts?: HttpOptions);
|
||
|
readonly statusChanged: boolean;
|
||
|
createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void;
|
||
|
getCurrentStatus(): AgentStatus;
|
||
|
}
|
||
|
|
||
|
namespace internal {
|
||
|
export class HttpsAgent extends internal {
|
||
|
constructor(opts?: HttpsOptions);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export = internal;
|
||
|
}
|