A tiny public tunnel for local HTTP servers.
Run this in a project with something listening on port 3000:
npx captun 3000
You get a URL like:
https://abc123.captun.sh
Requests to that URL are forwarded to your local server until you stop the process.
import { createCaptunTunnel } from "captun";
const tunnel = await createCaptunTunnel({
fetch: () => new Response("hello from my machine"),
});
console.log(tunnel.url);
npx captun deploy
Source: github.com/iterate/captun
Edit the fetch function, create a tunnel, then the iframe below will load the public URL.