Patch Changes
-
#8357
ff26dc2
Thanks @dario-piotrowicz! - feat: add newunsafeInspectorProxy
option to miniflareAdd a new
unsafeInspectorProxy
option 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'sinspectorPort
and 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-a
andworker-b
,
inspector clients can discover such workers viahttp://localhost:9229
and communicate with
them respectively viaws://localhost:9229/worker-a
andws://localhost:9229/worker-b
Note: this API is experimental, thus it's not being added to the public documentation and
it's prefixed byunsafe