unjs / untun

πŸš‡ Tunnel your local HTTP(s) server to the world! powered by Cloudflare Quick Tunnels.
Other
946 stars 14 forks source link

πŸš‡ untun

npm version npm downloads bundle

License

Tunnel your local HTTP(s) server to the world!

Powered by πŸ”₯ Cloudflare Quick Tunnels and used by πŸ‘‚ unjs/listhen.

Usage (CLI)

Globally run tunnel with npx:

npx untun@latest tunnel http://localhost:3000
◐ Starting cloudflared tunnel to http://localhost:3000
β„Ή Waiting for tunnel URL...
βœ” Tunnel ready at https://unjs-is-awesome.trycloudflare.com

Use npx untun tunnel --help for more usage info.

Usage (API)

Install package:

# npm
npm install untun

# yarn
yarn add untun

# pnpm
pnpm install untun

Import:

// ESM
import { startTunnel } from "untun";

// CommonJS
const { startTunnel } = require("untun");

Start tunnel:

const tunnel = await startTunnel({ port: 3000 });

Options

url

The local server URL to tunnel.

port

The local server PORT (only effective if url is not provided).

hostname

The local server hostname (only effective if url is not provided).

protocol

The local server protocol (only effective if url is not provided).

verifyTLS

Verify local server TLS certificate.

acceptCloudflareNotice

Accept cloudflare TOS by default.

Development

License

Made with πŸ’›

Published under MIT 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.