Add Bun bundle docs and Telegram grammY support
This commit is contained in:
7
src/telegram/proxy.ts
Normal file
7
src/telegram/proxy.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user