0.0.12 ā¢ Published 4 months ago
ctun v0.0.12
š 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
npm install ctun
# yarn
yarn add ctun
# pnpm
pnpm install ctun
Import:
// ESM
import { startTunnel, startTunnelAuto } from "ctun";
// CommonJS
const { startTunnel, startTunnelAuto } = require("ctun");
Start tunnel:
const tunnel = await startTunnel({ port: 3000 });
Start tunnel auto install cloudflared:
const tunnel = await startTunnelAuto({ port: 3000 });
Options
url
- Default:
{protocol}://{hostname}:{port}
The local server URL to tunnel.
port
- Default:
3000
The local server PORT (only effective if url
is not provided).
hostname
- Default:
localhost
The local server hostname (only effective if url
is not provided).
protocol
- Default:
http
The local server protocol (only effective if url
is not provided).
verifyTLS
- Default:
false
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.