Configuration

xpose can be configured via CLI flags and a config file.

CLI flags

FlagDescriptionDefault
--subdomainCustom subdomain for the tunnel URLRandom 12-char ID
--ttlTunnel time-to-live in seconds14400 (4h)
--from-turboAuto-discover port from Turborepofalse
--turbo-taskTurborepo task name to inspectdev
--turbo-filterTurborepo filter for package selection
--turbo-pathPath to the Turborepo project rootCurrent directory
-r, --resumeResume the previous tunnel session (same URLs, within 10 minutes)false
--domainPublic tunnel domain (for self-hosting)xpose.dev
--allow-ipsComma-separated IP addresses or CIDR ranges to allow
--rate-limitMax requests per minute per IP (0 = unlimited)
--corsEnable permissive CORS headers on all responsesfalse
--headerCustom response header (key:value), repeatable
--no-inspectDisable the local request inspection serverfalse
--inspect-portPort for the inspection server4194
--configPath to config fileauto-detect
--no-configSkip loading the config filefalse

Config file

Create an xpose.config.ts file in your project root for repeatable tunnel configurations. CLI flags override config file values.

import { defineConfig } from "@xpose/tunnel-core";

export default defineConfig({
  domain: "xpose.dev",
  tunnels: [
    {
      port: 3000,
      subdomain: "my-app",
      cors: true,
      allowIps: ["203.0.113.0/24"],
      rateLimit: 100,
      headers: { "X-Environment": "development" },
    },
    {
      port: 8787,
      subdomain: "my-api",
    },
  ],
});