Skip to content
Commit Detail

Commit 5c454bb

Author
Dan Lapid <dlapid@cloudflare.com> 2025-12-04 00:04:16 +0000
Parents
c5836a3
Tree
979a040
Add WorkerdDebugPort interface for dynamic RPC entrypoint access (#5568)

* Add WorkerdDebugPort interface for dynamic RPC entrypoint access

Introduces a new privileged debug port interface that enables dynamic
access to worker entrypoints at runtime.

Currently, service bindings between workerd processes must be configured
at startup in the config file. Changing binding targets requires a full
process restart. This is problematic for local development tools like
Miniflare, which need to dynamically re-target RPC connections at runtime.

Today, Miniflare works around this by running a Node.js TCP server that
sits between workerd processes and manually re-routes RPC traffic. This
adds significant complexity and overhead.

This commit implements the WorkerdDebugPort interface which exposes all
service entrypoints in a process through a privileged RPC interface.
External tools can now:

- Get direct access to any entrypoint with custom props at runtime
- Start events and invoke methods via JS RPC without HTTP overhead
- Dynamically switch between entrypoints without process restarts

This enables Miniflare to eliminate its TCP proxy layer and handle
dynamic RPC routing natively through workerd.

```
interface WorkerdDebugPort {
  getEntrypoint(service, entrypoint, props) -> (worker)
  getActor(service, entrypoint, actorId) -> (actor);
}
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed