Tunnel your local HTTP(s) server to the world! Powered by Cloudflare Quick Tunnels.
npm install untun[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![License][license-src]][license-href]
Tunnel your local HTTP(s) server to the world!
Powered by š„ Cloudflare Quick Tunnels and used by š unjs/listhen.
Globally run tunnel with npx:
``sh`
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.
Install package:
`shnpm
npm install untun
Import:
`ts
// ESM
import { startTunnel } from "untun";// CommonJS
const { startTunnel } = require("untun");
`Start tunnel:
`ts
const tunnel = await startTunnel({ port: 3000 });
`Options
$3
- Default:
{protocol}://{hostname}:{port}The local server URL to tunnel.
$3
- Default:
3000The local server PORT (only effective if
url is not provided).$3
- Default:
localhostThe local server hostname (only effective if
url is not provided).$3
- Default:
httpThe local server protocol (only effective if
url is not provided).$3
- Default:
falseVerify local server TLS certificate.
$3
- Default:
false
- Environment variable: UNTUN_ACCEPT_CLOUDFLARE_NOTICEAccept cloudflare TOS by default.
Development
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using pnpm install
- Run interactive tests using pnpm dev`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.
[npm-version-src]: https://img.shields.io/npm/v/untun?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/untun
[npm-downloads-src]: https://img.shields.io/npm/dm/untun?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/untun
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/untun/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/untun
[bundle-src]: https://img.shields.io/bundlephobia/minzip/untun?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=untun
[license-src]: https://img.shields.io/github/license/unjs/untun.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/untun/blob/main/LICENSE