//#region src/server/proxy.d.ts declare const methods: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"]; type Handler = (req: Request) => Promise; type OriginMatcher = string | RegExp; interface Proxy extends Record<(typeof methods)[number], Handler> { handle: Handler; } interface CreateProxyOptions { /** * List of allowed origins to proxy to, also enforced on redirects. * * @defaultValue the proxy route's own origin (i.e. same-origin only). This * prevents the proxy from being abused as an open proxy (SSRF) when no * allowlist is configured; a warning is logged in that case. */ allowedOrigins?: OriginMatcher[]; /** * Determine if the proxied request is allowed. * * @returns true if allowed, otherwise forbidden. */ filterRequest?: (request: Request) => boolean; /** * Override proxied request/response with yours */ overrides?: { request?: (request: Request) => Request; response?: (response: Response) => Response; }; } declare function createProxy(options?: CreateProxyOptions): Proxy; //#endregion export { CreateProxyOptions, Proxy, createProxy };