Course lesson 44 · Advanced Durable Objects

Service to Service Bindings

One study unit · Read, recall, then practice · Original video 00:10:49

The frontend’s Worker receives a service binding to the data service and becomes the browser’s WebSocket entry point. A small Hono application handles both tRPC routing and the socket proxy, adding an account header before forwarding the request through the binding. Local and deployed checks confirm that one click reaches multiple open dashboard tabs.

Primary source: course video 44 · Supplied English subtitles · 00:10:49.

Understand the idea

What the course does

  1. Remove the backend’s hardcoded account so it again reads the account header.
  2. Declare the data-service binding in the user application’s Wrangler configuration and regenerate types.
  3. Create Hono routes for existing tRPC handling and the new socket endpoint.
  4. Clone the incoming request with an account header and call the bound service’s fetch handler.
  5. Point the frontend environment at localhost for the local test, then at the deployed user-application host for deployment.
  6. Open two dashboard tabs and confirm that a redirect click broadcasts to both.

Watch for

Recall before revealing

What changes in the browser when the service binding is introduced?

Reveal the explanation

It targets the user application’s host instead of hardcoding the data service host; the Worker performs the forwarding.

Try it

Describe the request route from a dashboard tab to the account tracker, identifying where authentication will be added.

Check your result

Your route is browser → user-application Worker → bound data service → account Durable Object, with authentication at the user-application Worker.

Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.

Rewatch only what you need

Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.

Companion primary documentation: Workers remote procedure calls. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →