Tunnel your local HTTP(s) server to the world!
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.
Install package:
# npm
npm install ctun
# yarn
yarn add ctun
# pnpm
pnpm install ctun
Import:
// ESM
import { startTunnel } from "ctun";
// CommonJS
const { startTunnel } = require("ctun");
Start tunnel:
const tunnel = await startTunnel({ port: 3000 });
- Default:
{protocol}://{hostname}:{port}
The local server URL to tunnel.
- Default:
3000
The local server PORT (only effective if url
is not provided).
- Default:
localhost
The local server hostname (only effective if url
is not provided).
- Default:
http
The local server protocol (only effective if url
is not provided).
- Default:
false
Verify local server TLS certificate.
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.