import type { RequestInit as UndiciRequestInit } from "undici"; import { ProxyAgent, fetch as undiciFetch } from "undici"; import type { ZaloFetch } from "./api.js";
const proxyCache = new Map<string, ZaloFetch>();
export function resolveZaloProxyFetch(proxyUrl?: string | null): ZaloFetch | undefined { const trimmed = proxyUrl?.trim(); if (!trimmed) { return undefined;
} const cached = proxyCache.get(trimmed); if (cached) { return cached;
} const agent = new ProxyAgent(trimmed); const fetcher: ZaloFetch = (input, init) =>
undiciFetch(input, {
...init,
dispatcher: agent,
} as UndiciRequestInit) as unknown as Promise<Response>;
proxyCache.set(trimmed, fetcher); return fetcher;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.