CLI
Expose localhost from the command line.
The CLI is the easiest way to share a local development server, test webhooks, or preview a Vite/Next.js app with WebSocket and HMR support.
Usage
Run hostc with a local port. The CLI prints a public URL when the tunnel is ready.
Commands
hostc <port>
hostc 5173 --data-channels 4
hostc 8080 --local-host 127.0.0.1
hostc 3000 --server https://hostc.example.com
hostc 3000 --qr
hostc doctor 5173Configuration
Use config commands to persist a custom server URL or inspect the config path.
Config
hostc config get
hostc config set server-url https://hostc.example.com
hostc config unset server-url
hostc config pathDefault server
The public CLI defaults to
https://hostc.dev. Use --server or HOSTC_SERVER_URL for a self-hosted server.Keep it current
Use
npx hostc@latest or update global installs when the server protocol changes.Diagnostics
Run doctor before opening a tunnel if you want to check that the local port is reachable.
Doctor
hostc doctor 5173