openclaw/src/telegram/proxy.ts

11 lines
327 B
TypeScript
Raw Normal View History

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