Skip to main content

Function: proxyFetchDO()

proxyFetchDO(doInstance, req, doBindingName, handler?, options?, proxyInstanceNameOrId?): Promise<string>

Defined in: src/proxyFetch.ts:66

Send a fetch request to be executed by a ProxyFetchDO.

This is the DO variant that uses a dedicated Durable Object for fetch processing. For most use cases, prefer using the auto-detecting proxyFetch() function instead.

Parameters

doInstance

any

The Durable Object instance (pass this from within DO methods)

req

Request object or URL string to fetch

string | Request<unknown, CfProperties<unknown>>

doBindingName

string

Name of the DO binding for return routing

handler?

string

Optional name of the handler method on the DO to call with the response

options?

ProxyFetchOptions

Optional configuration for timeout, retries, etc.

proxyInstanceNameOrId?

string = 'proxy-fetch-global'

Returns

Promise<string>

Promise that resolves with the request ID when the request is enqueued