Configuration
xpose can be configured via CLI flags and a config file.
CLI flags
| Flag | Description | Default |
|---|---|---|
| --subdomain | Custom subdomain for the tunnel URL | Random 12-char ID |
| --ttl | Tunnel time-to-live in seconds | 14400 (4h) |
| --from-turbo | Auto-discover port from Turborepo | false |
| --turbo-task | Turborepo task name to inspect | dev |
| --turbo-filter | Turborepo filter for package selection | — |
| --turbo-path | Path to the Turborepo project root | Current directory |
| -r, --resume | Resume the previous tunnel session (same URLs, within 10 minutes) | false |
| --domain | Public tunnel domain (for self-hosting) | xpose.dev |
| --allow-ips | Comma-separated IP addresses or CIDR ranges to allow | — |
| --rate-limit | Max requests per minute per IP (0 = unlimited) | — |
| --cors | Enable permissive CORS headers on all responses | false |
| --header | Custom response header (key:value), repeatable | — |
| --no-inspect | Disable the local request inspection server | false |
| --inspect-port | Port for the inspection server | 4194 |
| --config | Path to config file | auto-detect |
| --no-config | Skip loading the config file | false |
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",
},
],
});