untun is a JavaScript/TypeScript utility for creating temporary, publicly accessible tunnels to local HTTP(S) servers using Cloudflare Quick Tunnels. Currently at version 0.1.3, it is in active pre-1.0 development, indicating frequent patch releases with potential API changes. It offers both a convenient CLI for quick usage and a programmatic API for integration into applications. Key differentiators include its tight integration with the Cloudflare `cloudflared` binary, its lightweight nature as part of the `unjs` ecosystem, and first-class TypeScript support. It simplifies exposing local development servers to the internet without manual Cloudflare setup or account requirements, making it ideal for testing webhooks, demos, and collaborative development.
npm install untunVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start a Cloudflare Quick Tunnel for a local server, including basic error handling and graceful shutdown.
Refer to the GitHub releases page for each update; consider using a version locking mechanism (e.g., `npm ci`) and thorough testing before upgrading in production.
Set `acceptCloudflareNotice: true` in the `startTunnel` options object or define `process.env.UNTUN_ACCEPT_CLOUDFLARE_NOTICE = 'true'` before running untun.
Monitor untun's release notes for `cloudflared` updates. If encountering unexpected tunnel behavior, check the official `cloudflared` documentation for the version untun is using.
Implement signal handlers (e.g., `process.on('SIGINT', ...)`) to ensure `await tunnel.close()` is called before the application exits.Add `acceptCloudflareNotice: true` to the `startTunnel` options, or set `process.env.UNTUN_ACCEPT_CLOUDFLARE_NOTICE = 'true'`.
Ensure your local server is running on the correct port, or choose an available port for your local server if using `untun`'s `port` option. Verify no other applications are using the target port.
Check for available system logs. Ensure `untun` has necessary execution permissions. If running in a restricted environment, verify network access for `cloudflared` to download updates or connect to Cloudflare. Try reinstalling `untun` to ensure a fresh `cloudflared` binary download.
No dependency data recorded yet.