evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a small HTTP client wrapper that directs traffic through configured proxies, applies TLS credentials, caches DNS lookups, and reuses sockets efficiently.
export interface ProxyClientConfig {
httpProxy?: string;
httpsProxy?: string;
noProxy?: string[]; // hostnames or domain suffixes to bypass proxies
ca?: string | Buffer | Array<string | Buffer>;
cert?: string | Buffer;
key?: string | Buffer;
strictSSL?: boolean;
dns?: {
ttl?: number;
};
maxSockets?: number; // per-origin socket pool limit
}
export interface RequestOptions {
method?: string;
headers?: Record<string, string>;
body?: any;
}
export type FetchClient = (
url: string,
options?: RequestOptions
) => Promise<{
status: number;
headers: Record<string, string>;
body: Buffer;
}>;
export function createFetchClient(config: ProxyClientConfig): FetchClient;Fetch-compatible HTTP client with proxy routing, agent pooling, DNS cache controls, and TLS configuration hooks. @satisfied-by