Skip to content

@alex.garcia/libfec / ProxyOption

Type Alias: ProxyOption ​

ProxyOption = string | ((url) => string)

Defined in: fetch.ts:14

How to route a request through a proxy, for a browser page: the FEC sends no CORS headers. Not needed in Node, Deno or Bun.

  • a string containing {url}: that placeholder is replaced by the URL-encoded target URL ("https://proxy.example/fetch?u={url}");
  • any other string: a prefix for the URL-encoded target URL ("https://proxy.example/?url=");
  • a function: given the target URL, returns the URL to fetch.