UNPKG

@extra/proxy-router

Version:
29 lines (28 loc) 875 B
import type { Server as ProxyServer } from 'proxy-chain'; export interface ConnectionLogEntry { /** Connection Id */ id: number; /** Proxy name */ proxy: string; /** Host */ host: string; } export interface ConnectionStats { srcTxBytes: number; srcRxBytes: number; trgTxBytes: number; trgRxBytes: number; } export declare class ProxyRouterStats { private proxyServer; /** Log of all connections (id, proxyName, host) */ connectionLog: ConnectionLogEntry[]; protected connectionStats: Map<number, ConnectionStats>; constructor(proxyServer: ProxyServer); /** Get bytes transferred by proxy */ get byProxy(): any; /** Get bytes transferred by host */ get byHost(): any; protected getStatsFromActiveConnections(): void; protected calculateProxyBytes(stats?: Partial<ConnectionStats>): number; }