https://github.com/hunghg255/ctun
Tunnel use cloudflare
https://github.com/hunghg255/ctun
cloudflare forwarding ngrok ngrok-tunnel npm tunnel
Last synced: 7 months ago
JSON representation
Tunnel use cloudflare
- Host: GitHub
- URL: https://github.com/hunghg255/ctun
- Owner: hunghg255
- License: other
- Created: 2023-08-17T05:12:28.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-13T08:34:22.000Z (10 months ago)
- Last Synced: 2024-08-13T10:11:26.916Z (10 months ago)
- Topics: cloudflare, forwarding, ngrok, ngrok-tunnel, npm, tunnel
- Language: TypeScript
- Homepage:
- Size: 421 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A script create a tunnel to your localhost use Cloudflare Argo Tunnel## Usage (CLI)
Globally run tunnel with `npx`:
```sh
npx ctun@latest --url http://localhost:3000
```Use `npx ctun --help` for more usage info.
## Result

## Usage (API)
Install package:
```sh
# npm
npm install ctun# yarn
yarn add ctun# pnpm
pnpm install ctun
```Import:
```ts
// ESM
import { startTunnel } from "ctun";
```Start tunnel:
```ts
const tunnel = await startTunnel({ 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](https://github.com/JacobLinCool/node-cloudflared)
Your installation of cloudflared software constitutes a symbol of your signature indicating that you accept the terms of the Cloudflare [License](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/), [Terms](https://www.cloudflare.com/terms/) and [Privacy Policy](https://www.cloudflare.com/privacypolicy/).