🚇 ctun


Tunnel your local HTTP(s) server to the world!
Usage (CLI)
Globally run tunnel with npx:
npx ctun@latest --url http://localhost:3000
◐ Starting cloudflared tunnel to http://localhost:3000
ℹ Waiting for tunnel URL...
✔ Tunnel ready at https://unjs-is-awesome.trycloudflare.com
✔ QR Code:
█▀▀▀▀▀▀▀██▀█████▀▀▀█▀▀█▀▀██▀▀▀▀▀▀▀█
█ █▀▀▀█ █▄ ▀ ▄█▀█▀█▄▀█ ▀▀██ █▀▀▀█ █
█ █ █ █▄▄▀▄▀▀▀▀█▄▀▀ ██▀▄█ █ █ █
█ ▀▀▀▀▀ █ █ █▀▄ ▄ ▄ █▀▄ █▀█ ▀▀▀▀▀ █
█▀▀▀▀▀█▀▀▀▀▀█ ▄▀▄▄▀██ ▄ ▀▀█▀█▀█▀██
█▀▄██ █▀█▄ █▀▀██▀ ▄▄▄▄▀▀▄▀▀ ██▀▄ ▄█
█ ▀██ ▀▀ █ ▄ ██▄█▄▀▄ ▄▄▀▀▀▀▄▀▀▀▄███
██▀▀▀▀▄▀▀▄█ █▄ ▀ ▄▄▀█▀▄█ ▄█▀██ ▄█
█▀▄▀▄█▀▀ ▄ ▀█ ▄▀▀█▀█▀▀▄ ▀██▄▀█▄▀██
█▀█▀█▄▄▀ ▄▄█▀▀██▀▄██▄ █▀▄█▀ ██ █ ▄█
███▀▀█▄▀▄▄██ ██▄█▄▀███▄ ▀ █▀▀█▄▀██
█ ▄█▀ ▀ ████▄ ▀▀█▄▄▄▄▄▄█▄▄▀▀ █ ▄█
█ █▀▄▄█▀▄▀▄▀█ ▄▀ ▄▀▄▀▄▄ ▄ ▀▀ ▀ ▄█▀█
█▀▀▀▀▀▀▀█ █▀▀▀██▀▄▀▄▄ ▀ █▀█ █▄▀▄█
█ █▀▀▀█ █▀▀▄ ██▄▀▀▀▄█▄▄▄▄ ▀▀▀ ▄▄█ █
█ █ █ █ ▀▀█▄ ▀ ▄▄▄▄▀▀▄▄▄▀█▄ ▄▄█
█ ▀▀▀▀▀ █ ███ ▄▀ █▀▄▄▀▄ ▀█▄ █ ▄▀██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Use npx ctun --help for more usage info.
Usage (API)
Install package:
npm install ctun
yarn add ctun
pnpm install ctun
Import:
import { startTunnel } from "ctun";
const { startTunnel } = require("ctun");
Start tunnel:
const tunnel = await startTunnel({ port: 3000 });
Options
url
- Default:
{protocol}://{hostname}:{port}
The local server URL to tunnel.
port
The local server PORT (only effective if url is not provided).
hostname
The local server hostname (only effective if url is not provided).
protocol
The local server protocol (only effective if url is not provided).
verifyTLS
Verify local server TLS certificate.
License
Cloudflared integration based on a fork of JacobLinCool/node-cloudflared
Your installation of cloudflared software constitutes a symbol of your signature indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.