fast-proxy-balancer
Version:
Smart and flexible proxy balancer for Node.js
26 lines • 865 B
TypeScript
import type { Proxy, ProxyBalancerOptions, ProxyStats, ProxyAgentResult } from './interfaces/interfaces.js';
declare class ProxyBalancer {
protected proxies: Proxy[];
private proxyListOrFile;
private maxFailures;
private testTimeout;
private refreshInterval;
private concurrentTests;
private testUrl;
constructor(proxyListOrFile: string | string[], options?: ProxyBalancerOptions);
init(): Promise<void>;
refreshProxies(): Promise<void>;
getBestProxy(): Promise<ProxyAgentResult>;
startAutoRefresh(): void;
getProxyStats(): ProxyStats[];
sortByLatency(): ProxyStats[];
getFailedProxies(): ProxyStats[];
getStatsSummary(): {
total: number;
active: number;
failed: number;
avgLatency: string;
};
}
export { ProxyBalancer };
//# sourceMappingURL=ProxyBalancer.d.ts.map