Course lesson 42 · Advanced Durable Objects

Connecting from the Client (Localhost)

One study unit · Read, recall, then practice · Original video 00:09:07

The frontend hook is connected to the locally running data service to verify the WebSocket handshake before adding richer server behavior. Incoming messages feed the shared geographic click store, whose state drives the map. The lesson then explains the intended architecture: browsers connect through the user application’s Worker, where authentication will happen, and that Worker proxies to the data service.

Primary source: course video 42 · Supplied English subtitles · 00:09:07.

Understand the idea

What the course does

  1. Start both the user application and data service development servers.
  2. Inspect the dashboard’s disconnected indicator and its socket hook.
  3. Temporarily point the browser at the data service on localhost port 8787.
  4. Observe failed requests caused by the missing account header, then temporarily hardcode an account in the backend.
  5. Confirm connected status and a pending network connection; close a tab to observe the close event.
  6. Restore the browser’s environment-based host setting before proceeding to the service-binding architecture.

Watch for

Recall before revealing

Why place the socket proxy in the user application’s Worker?

Reveal the explanation

That server can validate the user and choose authorized account data before forwarding the connection to the data service.

Try it

Write a three-observation checklist for a successful local socket connection.

Check your result

Your checklist includes connected UI state, a persistent pending socket request, and a server close event after closing the tab.

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: Durable Objects WebSockets. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →