Quick deployment
For quick preview deployments we recommend using Cloudflare Tunnel ↗︎ to generate preview URLs to your web services. These work across local development, workers.dev and production usage.
await sandbox.startProcess("python -m http.server 8000");
const tunnel = await sandbox.tunnels.get(8000);
console.log(tunnel.url);
// https://acute-llama-dancing-roundly.trycloudflare.app
// Request will be routed directly to the webserver running on the sandbox.
const req = await fetch(`${tunnel.url}/api/users`); // => GET http://localhost:8000/api/users
Cloudflare Tunnel support currently has the following limitations:
- No control over generated URL.
- No authentication mechanism beyond randomly generated URL.
- Each URL uses an additional
cloudflaredprocess on the sandbox.
Production requires custom domain
We are working on production deployments, custom hostnames and authentication for Cloudflare Tunnel support. In the mean time we recommend using exposePort() and proxyToSandbox() documented below under Production usage, stable URLs and custom domains.
See the tunnels API reference for the full API and feature set.
