A simple tool automates running a Cloudflare-Tunnel for exposing your local host to the world! it could be used as a standalone CLI or imported into other libraries CLI's
npm install cloudflared-tunnelcf-tunnel
bash
yarn install -g cloudflared-tunnel
`
$3
$3
`bash
cf-tunnel -s
`
OR
`bash
cf-tunnel setup
`
$3
`bash
cf-tunnel [-p ] [-h ] [-s]
`
$3
#### cf-tunnel
Runs a cloudflared tunnel simply with a single command
`bash
cf-tunnel
`
#### Options
`bash
-p, --port=port # port to expose
-h, --host=host # host to expose
-s, --setup # setup cloudflared tunnel
`
Usage as a library
$3
`bash
yarn add cloudflared-tunnel
`
`ts
import {setup, startTunnel} from 'cloudflared-tunnel'
await setup() // setup the project | you need to do this only once
await startTunnel({
host: 'http://localhost', // required
port: 3000, // required
}) // pass in the host and port of the server you want to tunnel
``