MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / proxyFetch

Function proxyFetch

src/utils/proxy-fetch.ts:104–111  ·  view source on GitHub ↗
(input: string | URL, init?: RequestInit)

Source from the content-addressed store, hash-verified

102 * Falls through to the global fetch when no proxy applies.
103 */
104export async function proxyFetch(input: string | URL, init?: RequestInit): Promise<Response> {
105 const url = typeof input === 'string' ? input : input.toString();
106 const dispatcher = getDispatcherForUrl(url);
107 if (!dispatcher) return fetch(input, init);
108 // Node's fetch accepts a `dispatcher` option via the undici-bridge but TypeScript's
109 // built-in lib.dom RequestInit doesn't know about it. Cast through any.
110 return fetch(input, { ...(init ?? {}), dispatcher } as any);
111}
112
113/** Test/debug helper: force-reset the cached config + dispatchers. */
114export function _resetProxyCacheForTesting(): void {

Callers 11

probeFunction · 0.85
executeMethod · 0.85
searchMethod · 0.85
executeMethod · 0.85
searchMethod · 0.85
fetchOnceMethod · 0.85
executeMethod · 0.85
searchMethod · 0.85
probeEndpointFunction · 0.85
tryOllamaRerankFunction · 0.85
tryOpenAIRerankFunction · 0.85

Calls 1

getDispatcherForUrlFunction · 0.85

Tested by

no test coverage detected