Skip to content

xport <port>

Terminal window
xport 3000

Registers a tunnel session on the configured relay and prints the public URL. The session stays alive until you stop the command (Ctrl-C) or it expires.

Example output:

Forwarding: https://k7fz2.xport.sh → http://localhost:3000
Expires: 2026-10-19 13:05:14 CET
Press Ctrl-C to stop.
  1. The CLI opens a WebSocket to the relay’s control endpoint (relay.url, default: local development relay at http://localhost:8080).
  2. It sends a register message; the relay assigns a random name and replies with the public URL.
  3. A heartbeat keeps the session alive until you stop the command.

All persistent options apply: --name, --domain, --policy-file, --expires, --password, --qr, --copy, --rewrite, --detach, --json.

Apps that generate absolute URLs from their configured base URL — most notably WordPress — serve CSS, JS and links pointing at the local address, so a tunnel shows an unstyled page. Two ways out:

  1. xport 3000 --rewrite rewrites responses on the fly: Location headers always, and bodies of HTML, CSS, JS, JSON, SVG and other text types, replacing the local target’s origin (e.g. http://localhost:8080) with the public URL — including protocol-relative //localhost:8080 references. Binary and pre-compressed responses pass through unchanged. Also settable per endpoint (rewrite: true) or as a default in the config (tunnel.rewrite: true).

  2. Teach the app the public host. The tunnel preserves the public Host header, so for WordPress this wp-config.php snippet (above the “That’s all” line) makes every generated URL absolute-correct:

    define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
    define('WP_SITEURL', WP_HOME);

Both approaches leave absolute URLs saved inside post content untouched — regenerate or rewrite those in the database if you need them.