/** * Free proxy auto-selection for bot-protection bypass. * * Source: proxifly/free-proxy-list (MIT) via jsDelivr CDN. * These are datacenter proxies — they bypass simple IP blocks but NOT * full Cloudflare Bot Manager / Akamai. For Cloudflare-protected sites, * users need a residential proxy (Bright Data, Oxylabs, etc.). */ /** * Pick a working free proxy. Tests in parallel batches of 10 with a 4s timeout. * Returns null if no working proxy found (not an error — crawl can proceed without proxy). */ export declare function pickFreeProxy(): Promise; export type ProxyTier = 'free' | 'datacenter' | 'residential' | 'premium'; export interface ProxyTierConfig { /** List of proxy URLs for this tier. E.g. ['http://user:pass@dc1.proxy:8080'] */ urls: string[]; tier: ProxyTier; } /** * Tiered proxy manager with per-domain error histograms. * * Tracks success/failure per domain and automatically escalates to higher proxy tiers * on consecutive failures. Applies time-decay to probe returning to lower tiers. * * Usage: * const mgr = new TieredProxyManager([{ tier: 'datacenter', urls: [...] }]); * const proxy = await mgr.selectProxy('api.salesforce.com'); * // ... make request ... * mgr.recordResult('api.salesforce.com', success); */ export declare class TieredProxyManager { private tiers; private domainHistory; private readonly ESCALATE_AFTER; private readonly DECAY_AFTER_MS; constructor(configs: ProxyTierConfig[]); private getHistory; private lowestAvailableTier; /** Pick a proxy URL for this domain, based on its tier history. */ selectProxy(domain: string): string | null; /** Record a request result for a domain. Triggers tier escalation on repeated failures. */ recordResult(domain: string, success: boolean): void; stats(): Array<{ domain: string; tier: ProxyTier; successRate: number; totalRequests: number; }>; }