import { type ProxyOptions } from "https://dotland.deno.dev/x/oak@v17.1.2/middleware/proxy.ts";
Options which can be specified on the proxy
middleware.
Type Parameters
Properties
The fetch function to use to proxy the request. This defaults to the
global {@link fetch
} function. It will always be called with a
second argument which contains an object of { context }
which the
context
property will be an instance of RouterContext
.
This is designed for mocking purposes or implementing a fetch()
callback that needs access the current context when it is called.
Additional headers that should be set in the response. The value can be a headers init value or a function that returns or resolves with a headers init value.
Either a record or a proxy map function that will allow proxied requests being handled by the middleware to be remapped to a different remote path.
Methods
A callback hook that is called after the response is received which allows the response content type to be adjusted. This is for situations where the content type provided by the proxy server might not be suitable for responding with.