miniflare@4.20250317.1
Patch Changes
-
#8357
ff26dc2Thanks @dario-piotrowicz! - feat: add newunsafeInspectorProxyoption to miniflareAdd a new
unsafeInspectorProxyoption to the miniflare worker options, if
at least one worker has the option set then miniflare will establish a proxy
between itself and workerd for the v8 inspector APIs which exposes only the
requested workers to inspector clients. The inspector proxy communicates through
miniflare'sinspectorPortand exposes each requested worker via a path comprised
of the worker's nameexample:
import { Miniflare } from "miniflare"; const mf = new Miniflare({ // the inspector proxy will be accessible through port 9229 inspectorPort: 9229, workers: [ { name: "worker-a", scriptPath: "./worker-a.js", // enable the inspector proxy for worker-a unsafeInspectorProxy: true, }, { name: "worker-b", scriptPath: "./worker-b.js", // worker-b is not going to be proxied }, { name: "worker-c", scriptPath: "./worker-c.js", // enable the inspector proxy for worker-c unsafeInspectorProxy: true, }, ], });
In the above example an inspector proxy gets set up which exposes
worker-aandworker-b,
inspector clients can discover such workers viahttp://localhost:9229and communicate with
them respectively viaws://localhost:9229/worker-aandws://localhost:9229/worker-bNote: this API is experimental, thus it's not being added to the public documentation and
it's prefixed byunsafe