@cloudflare/sandbox@0.11.0
Minor Changes
-
#708
287ec04Thanks @ghostwriternr! - Prevent stale preview URLs from waking or reaching sandbox runtimes. Invalid, revoked, or destroyed preview URLs return404 INVALID_TOKEN; authorized URLs that are not activated for the current runtime return410 STALE_PREVIEW_URLuntil the port is exposed again. Existing preview URLs that previously survived container restart now return410 STALE_PREVIEW_URLafter a restart until the port is exposed again in the new runtime.getExposedPorts()andisPortExposed()now report only ports that are currently preview-forwardable in the active runtime.unexposePort()is now idempotent: revoking a port that is not currently exposed succeeds without contacting the container. Preview URL state no longer uses the container-local exposed-port registry or proxy routes.
Patch Changes
-
#733
d4a739bThanks @scuffi! - Allow backup and restore presigned URLs to target non-default R2 endpoints. SetBACKUP_BUCKET_ENDPOINT, for examplehttps://<account_id>.eu.r2.cloudflarestorage.com, when your backup bucket uses an R2 jurisdiction. -
#732
8b9ec84Thanks @ghostwriternr! - Add bridge endpoints for managing tunnels to sandbox services. HTTP clients can callPOST /v1/sandbox/:id/tunnel/:portwith an optionalnamebody field for a predictable named URL, andDELETE /v1/sandbox/:id/tunnel/:portto remove the tunnel. -
#730
de68927Thanks @ghostwriternr! - Classify Office Open XML files such as.xlsxand.docxas binary when reading files so they are returned with base64 encoding instead of text decoding. -
#722
95bb7b9Thanks @aron-cf! - Add named-tunnel support tosandbox.tunnels.get(port, { name }). Named tunnels bind a user-controlled hostname (<name>.<your-zone>) backed by a Cloudflare Tunnel and a proxied CNAME on your zone, so the URL is stable across container restarts and across sandboxes that share the same name. Callingsandbox.destroy()tears down the Cloudflare tunnel and DNS record alongside the container.const tunnel = await sandbox.tunnels.get(8080, { name: 'app' }); console.log(tunnel.url); // → https://app.example.com