@vite-libs/tunnel
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Vite Tunnel

Screenshot

Vite Tunnel is an Vite plugin that allows you to expose your local Vite server to the internet using Cloudflare Tunnel.

Installation

To install Vite Tunnel, run the following command with your preferred package manager:

npm install -D @vite-libs/tunnel

Usage

import { defineConfig } from "vite";

import ViteTunnelPlugin from "@vite-libs/tunnel";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [ViteTunnelPlugin()],
});

Upon first starting a tunnel, you will be prompted to accept the terms of the Cloudflare License, Terms and Privacy Policy on the command line. Once you accept these terms, a tunnel will be initiated and a public URL for your local Vite server will be displayed inside the toolbar.

Configuration

Vite Tunnel accepts the following options:

ViteTunnelPlugin({
  // The URL to expose. Defaults to {protocol}://{hostname}:{port}.
  url: 'http://localhost:5521',
  // The local server port to expose. Defaults to 5521. (Only used if `url` is not set)
  port: 5521,
  // The local server hostname to expose. Defaults to localhost. (Only used if `url` is not set)
  hostname: "localhost",
  // The local server protocol to use. Defaults to http. (Only used if `url` is not set)
  protocol: "http",
  // Whether to verify the local server TLS certificate. Defaults to false. 
  verifyTLS: false,
  // Whether to accept the Cloudflare terms of service. Defaults to false.
  acceptCloudflareNotice: false,
});

Package Sidebar

Install

npm i @vite-libs/tunnel

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

13.5 kB

Total Files

9

Last publish

Collaborators

  • myrax_byte