Type Alias ProxyOptions
dictionary?: DictionaryOptions;
embeds?: EmbedOptions;
exposeTags?: boolean;
fetch?: (request: Request) => Promise<Response>;
ignore?: readonly RegExp[];
images?: ImageOptions;
maxBytes?: number;
maxRemembered?: number;
maxTags?: number;
origin: string | URL;
publicCookies?: readonly string[];
purgeSecret?: string;
routes?: readonly ProxyRoute[];
spool: Omit<SpoolOptions, "routes">;
trim?: TrimManifest;
video?: VideoOptions;
}
Properties
Optionaldictionary
Serves a stylesheet or script as dcz or dcb against an earlier public file of the same
directory the visitor already holds (RFC 9842, Chromium 130 and later); see
DictionaryOptions. Without it no response is marked or encoded.
Optionalembeds
Replaces server-rendered YouTube and Vimeo <iframe> embeds with a link that loads the
player on click; see EmbedOptions. A page that sends a Content-Security-Policy is left
alone. Without it no embed is touched.
Optionalexpose Tags
keep the tag headers on what the browser receives; default false
Optionalfetch
how requests reach the origin; default global fetch. A Workers service binding passes its fetch
Optionalignore
patterns blanked before a page is hashed, such as a per-render form token
Optionalimages
Converts JPEG and PNG responses to WebP for a browser that accepts it, at the quality and
width the request's headers call for, up to a width ceiling of 2560 pixels when the request
names none. Identical simultaneous requests share one encoder call, and an encoder that runs
past 10 seconds is abandoned for that request. See ImageOptions. Without it no image is
touched.
Optionalmax Bytes
largest page body kept, in bytes; default 2 MiB
Optionalmax Remembered
most pages whose last body hash is remembered, the oldest going first; default 10,000
Optionalmax Tags
most tags one response may name before it is not kept; default 512
origin
the origin to forward to, such as https://origin.internal; no path
Optionalpublic Cookies
cookie names that carry no identity, such as a bot-check or load-balancer cookie: they do not make a request ineligible, and setting them does not clear the device; default none
Optionalpurge Secret
the shared secret POST /.spool/purge requires; without one every purge is refused
Optionalroutes
routes that override the default of one public assembly route per path; they match first
spool
the options createSpool takes, minus routes: the worker's route list is fixed when the
spool is created, and the proxy puts its own catch-all route there
Optionaltrim
trimmed stylesheets from buildTrimManifest. A same-origin stylesheet in the manifest is
answered with its trimmed text when the origin's bytes still hash to the manifest's source,
and every HTML page is checked against the guard first. Without it nothing is trimmed.
Optionalvideo
Rewrites <video> tags in HTML responses, such as preload="none"; see VideoOptions.
Without it no page is touched for video.
what
spoolProxytakes