Is it possible to setup two workers that bind to each other?

Hi, I'm trying to setup a system with two separate workers: first one terminates a client WebSocket connection using a durable object and routes the WebSocket messages to another worker that provides data sync functionality for clients. The data-sync worker might also need to send replies periodically to clients connected via WebSocket to the first worker.

I'm setting up service bindings based on this docs page: https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#configuration
Both workers expose an entrypoint class and accepts RPCs and routes them to DurableObjects.

I'm testing this with a unstable_dev test like described here: https://developers.cloudflare.com/workers/wrangler/api/#multi-worker-example

Unfortunatelly the test fails with:

 [ERROR] Cannot access `sendMessage` as we couldn't find a `wrangler dev` session for service "router" to proxy to.


It seems like there's no way to create a pair of circular bindings between two workers?

Are there any alternatives that would keep the system topology mostly intact: i.e. two workers with durable objects that are able to send messages to each other?
image.png
Was this page helpful?