cloudflared-tunnel
v1.0.3
Published
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
Downloads
212
Readme
Cloudflared Tunnel
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
Pre-requisites
- Cloudflare account
- A Domain that is managed by Cloudflare you can transfer your domain management to Cloudflare from your current registrar for free
Usage CLI
Install CLI
yarn install -g cloudflared-tunnel
Setup
Note: you need to do this only once
cf-tunnel -s
OR
cf-tunnel setup
Run
cf-tunnel [-p <port>] [-h <host>] [-s]
Commands
cf-tunnel
Runs a cloudflared tunnel simply with a single command
cf-tunnel
Options
-p, --port=port # port to expose
-h, --host=host # host to expose
-s, --setup # setup cloudflared tunnel
Usage as a library
Install Library
yarn add cloudflared-tunnel
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