openclaw-vainplex/src/telegram/proxy.ts
2025-12-07 22:47:05 +01:00

7 lines
280 B
TypeScript

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