ProxyAdapter
ProxyAdapter =
object
What the platform supplies to createProxy.
Methods
Section titled “Methods”botCategory()
Section titled “botCategory()”botCategory(
request):string|null
The platform’s verified-bot category for this request, such as
request.cf.verifiedBotCategory on Cloudflare, or null. Return null
when the platform cannot verify bots. No request then bypasses decide,
which is safer than trusting a user agent.
Parameters
Section titled “Parameters”request
Section titled “request”Request
Returns
Section titled “Returns”string | null
fetch()
Section titled “fetch()”fetch(
request):Promise<Response>
The platform’s fetch. The proxy uses it for the upstream site, the tenant and decide.
Parameters
Section titled “Parameters”request
Section titled “request”Request
Returns
Section titled “Returns”Promise<Response>
rewriter()
Section titled “rewriter()”rewriter():
ProxyRewriter
A new ProxyRewriter. The proxy may build several for one request.
Returns
Section titled “Returns”warn()
Section titled “warn()”warn(
code,detail):void
Receives every ProxyWarning with its detail. It must not throw, because the proxy calls it from its own error handling.
Parameters
Section titled “Parameters”detail
Section titled “detail”Record<string, unknown>
Returns
Section titled “Returns”void