Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Type Alias ProxyOptions

    what spoolProxy takes

    type 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;
    }
    Index
    dictionary?: DictionaryOptions

    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.

    embeds?: EmbedOptions

    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.

    exposeTags?: boolean

    keep the tag headers on what the browser receives; default false

    fetch?: (request: Request) => Promise<Response>

    how requests reach the origin; default global fetch. A Workers service binding passes its fetch

    ignore?: readonly RegExp[]

    patterns blanked before a page is hashed, such as a per-render form token

    images?: ImageOptions

    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.

    maxBytes?: number

    largest page body kept, in bytes; default 2 MiB

    maxRemembered?: number

    most pages whose last body hash is remembered, the oldest going first; default 10,000

    maxTags?: number

    most tags one response may name before it is not kept; default 512

    origin: string | URL

    the origin to forward to, such as https://origin.internal; no path

    publicCookies?: readonly string[]

    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

    purgeSecret?: string

    the shared secret POST /.spool/purge requires; without one every purge is refused

    routes?: readonly ProxyRoute[]

    routes that override the default of one public assembly route per path; they match first

    spool: Omit<SpoolOptions, "routes">

    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

    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.

    video?: VideoOptions

    Rewrites <video> tags in HTML responses, such as preload="none"; see VideoOptions. Without it no page is touched for video.