Skip to contentOutRay/Docs
GitHub ↗
Get started ↗
Documentation

Your services, from local to live.

OutRay documentation

Products

Tunnels

Getting started

InstallationAuthenticationOpening a Tunnel

Features

Reserved SubdomainsPassword ProtectionCustom DomainsTeams & OrganizationsCI/CD Integration

Integrations

Vite Plugin

Reference

TCP & UDP TunnelsCLI ReferenceArchitecture
Tunnels

Vite Plugin

Open a development tunnel when Vite starts listening.

@outray/vite opens an HTTP tunnel for Vite's development server. It is a tunnel plugin, not an application observability SDK.

Install and configure

npm install --save-dev @outray/vite

Add it alongside your existing framework plugins in vite.config.ts:

import { defineConfig } from "vite";
import outray from "@outray/vite";

export default defineConfig({
  plugins: [
    outray({
      apiKey: process.env.OUTRAY_API_KEY,
      subdomain: "my-app",
    }),
  ],
});

Create a token with tunnel:connect and provide it through a server-side environment variable or the apiKey option. The plugin does not read the CLI's saved login.

Run your normal Vite development command. OutRay waits for the HTTP server's listening event, detects the actual port, and prints the assigned public URL. Closing the dev server closes its tunnel.

Options

OptionDefaultPurpose
apiKeyOUTRAY_API_KEYTunnel credential
subdomainOUTRAY_SUBDOMAINRequested subdomain
customDomainUnsetVerified tunnel domain
serverUrlOUTRAY_SERVER_URL or wss://connect.outray.co/Tunnel server
enabledOUTRAY_ENABLED !== "false"Enable the tunnel plugin
silentfalseSuppress plugin status output
localfalseAlso advertise LAN access via mDNS

onTunnelReady(url), onError(error), onClose(), and onReconnecting() let your application react to tunnel lifecycle events. onLocalReady(info) reports the local hostname, IP, and available local URLs when local is enabled.

The plugin applies to Vite's serve command, not production builds. Its package supports Vite 4, 5, 6, and 7.

Authentication and host configuration

Do not put the token in a VITE_* variable or client-side import; Vite exposes those values to browser bundles.

If Vite rejects the tunnel hostname, add the actual public hostname to the development server's allowed hosts. Keep that allowlist specific to the host you use.

If no tunnel starts, check that the server listens on a TCP port rather than a Unix socket, OUTRAY_ENABLED is not "false", and the token has permission for the intended organization.

Telemetry is separate

This plugin does not initialize OpenTelemetry, export application logs or metrics, or provide SDK payload-capture options. The tunnel console can still show traffic passing through the public endpoint.

For a TanStack Start application, configure the TanStack Start SDK separately. Other Node.js servers can use the Node.js SDK.

CI/CD Integration

Authenticate a temporary tunnel in a non-interactive runner.

TCP & UDP Tunnels

Forward raw socket services and understand the public endpoint's security boundary.

On this page

Install and configureOptionsAuthentication and host configurationTelemetry is separate