Files
clawdbot/src/telegram/proxy.ts
2025-12-23 00:28:55 +00:00

11 lines
327 B
TypeScript

// @ts-nocheck
import { ProxyAgent } from "undici";
export function makeProxyFetch(proxyUrl: string): typeof fetch {
const agent = new ProxyAgent(proxyUrl);
return (input: RequestInfo | URL, init?: RequestInit) => {
const base = init ? { ...init } : {};
return fetch(input, { ...base, dispatcher: agent });
};
}