Skip to content
v0.1.0-alpha.3
On this page

Configuration and Deployment

Bridge environment variables, token and origin policy, browser isolation headers, and documentation hosting checks.

WVST has two deployment targets: the browser-facing site, and the Bridge/host worker on the user's computer. Hosting the docs does not install, start or remotely replace the user's local plugin runtime.

Local authorization

The standalone CLI's serve requires a nonempty WVST_TOKEN. Each WebSocket must complete bridge.hello with that token, including the separate UI and audio-worker sockets. Embedded BridgeConfig::development() can use a token-free policy; that is not the CLI default.

This local development configuration allows one exact page origin:

Shell
WVST_TOKEN=local-dev-token \WVST_ALLOWED_ORIGINS=http://localhost:5173 \WVST_ALLOW_LOOPBACK_ORIGINS=false \WVST_HOST_WORKER=target/debug/wvst-host-worker \ target/debug/wvst-bridge-server serve

Open http://localhost:5173 and enter the same token in Studio. http://127.0.0.1:5173 is a different origin, and changing the port changes the origin too.

WVST_ALLOWED_ORIGINS adds exact allowed values; loopback pages remain automatically allowed by default. Set WVST_ALLOW_LOOPBACK_ORIGINS=false as well to disable that automatic rule. Supply the webpage origin (scheme, host, port), without /demo or the Bridge's WebSocket URL.

Origin checks constrain browser sources. Native clients without an Origin are not rejected by that policy, so it does not replace token authorization. The CLI uses a configured shared token; it does not provide a complete short-lived pairing-code, user-account or automatic browser enrollment flow. Rotate the configured token by restarting the Bridge and reconnecting clients.

To connect from the hosted Studio, start the Bridge with WVST_ALLOWED_ORIGINS=https://wvst.pwp.sh in addition to its token and worker path. Restart an already running Bridge after changing its environment.

Bridge environment variables

Configuration is read at startup. Run diagnose with the same environment when investigating; variables in another shell do not change an existing process.

VariableDefaultMeaning
WVST_TOKENUnset; required by CLINonempty session token; keep it out of public frontend configuration.
WVST_BIND_ADDR127.0.0.1:35876Listen address and port; match the browser endpoint. Keep deployment on loopback.
WVST_HOST_WORKERAuto-discoveryExecutable path; prefer an absolute path for services or other working directories.
WVST_ALLOWED_ORIGINSEmpty listComma-separated exact additional origins.
WVST_ALLOW_LOOPBACK_ORIGINStrue0 or false disables automatic allowance of local pages.
WVST_WORKER_AUTO_RESTARTtrue0 or false disables automatic worker restart.
WVST_WORKER_LOAD_TIMEOUT_MS120000Plugin initialization, factory metadata and state/preset loading budget; ordinary IPC/audio keeps its separate 5-second deadline.
WVST_MAX_WORKER_INSTANCES64Concurrent worker cap, not a performance promise for 64 realtime plugins.
WVST_WORKER_QUARANTINE_FAILURES3Failure threshold for plugin quarantine.
WVST_MAX_CONTROL_MESSAGE_BYTES16777216 (16 MiB)JSON control message cap, including large state snapshots.
WVST_WORKER_MEMORY_LIMIT_BYTESUnsetWorker address-space limit where supported; not an RSS measurement.
WVST_WORKER_CPU_TIME_LIMIT_SECONDSUnsetCumulative CPU time limit where supported, not an individual process-call timeout.
WVST_WORKER_LINUX_CGROUP_PARENTUnsetWritable Linux cgroup parent.
WVST_WORKER_LINUX_CGROUP_MEMORY_MAX_BYTESUnsetCgroup memory ceiling; requires cgroup setup.
WVST_WORKER_LINUX_CGROUP_CPU_QUOTA_MICROSUnsetCgroup CPU quota in microseconds.
WVST_WORKER_LINUX_CGROUP_CPU_PERIOD_MICROS100000Cgroup CPU quota period in microseconds.

Inspect events and worker diagnostics before adjusting limits for repeated failures. Larger limits do not fix architecture or bus-layout incompatibility.

Large instruments can need more than the default 120-second initialization/state budget. Increase WVST_WORKER_LOAD_TIMEOUT_MS and the browser SDK's transportOptions.requestTimeoutMs together; its default is 180 seconds. The SDK uses independent 10-second handshake and binary-response deadlines. See API reference for socket timeout behavior. Increasing a deadline does not provide load cancellation, sample-library progress, or a realtime performance guarantee.

Browser isolation and assets

Serve low-latency pages over HTTPS or browser-trusted localhost with:

Text
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corp

Check the final page response, not only configuration files:

Shell
curl -I http://localhost:4173/demo

Verify isSecureContext, crossOriginIsolated and typeof SharedArrayBuffer === 'function' in the console. COEP affects third-party images, fonts, scripts and embeds: use same-origin assets or appropriate CORS/CORP responses. Worker and worklet URLs must return JavaScript, not HTML from an SPA fallback.

Isolation and local WebSocket access are separate checkpoints. A remote HTTPS page accessing ws://127.0.0.1:35876 is also subject to browser mixed-content rules, local-network permissions and enterprise policies. The Bridge CLI serves ws://; changing the URL to wss:// does not enable TLS. Deployments needing TLS must supply a trusted local TLS terminator. Establish a working localhost setup first, then validate remote hosting in the target browser.

Build the docs site

From the repository root:

Shell
npm cinpm run docs:checknpm run docs:buildnpm --workspace @wvst/docs run preview

The default build uses the Cloudflare adapter. Local preview normally prints http://localhost:4173. For static hosting:

Shell
npm run build:webnpm --workspace @wvst/docs run build:static

The static adapter's default output is docs/build. Do not upload an edge build as if it were a plain static directory; match deployment to the adapter.

Execution modeHeader provider
Vite developmentserver.headers in docs/vite.config.ts.
Local production previewPreview middleware in the same file.
SvelteKit dynamic responsesdocs/src/hooks.server.ts.
Cloudflare assetsAsset rules in docs/_headers.
Other static hostingConfigure the host or reverse proxy; static pages do not execute server hooks.

The production site is https://wvst.pwp.sh. Its site.url is configured in docs/svedocs.config.ts for canonical, sitemap and OG URLs. The Pages alias is wvst-docs.pages.dev. Bind wvst.pwp.sh in the project’s Custom domains and point a proxied wvst CNAME to wvst-docs.pages.dev; DNS alone does not bind the hostname to the project.

The Cloudflare Pages project is wvst-docs, with production branch main. After authenticating Wrangler, run npm run docs:deploy from the repository root to check, build and upload. The project uses direct uploads: Git pushes run CI but do not automatically deploy. Other Git branches produce preview deployments.

Verify after deployment

  1. Open both locales, the homepage and Studio; refresh a deep documentation route.
  2. Inspect response headers and ensure Worker, worklet, logo and search assets load.
  3. Check browser prerequisites, then connect to a local Bridge with its token.
  4. Add the actual webpage origin to the Bridge allowlist and handle any browser local-network permission required by the deployment.
  5. Play a local file, mount a known working effect, then check parameters, bypass and metrics.

See repository docs/README.md for site maintenance and Development for package and real-plugin validation.