hostc
v1.3.0
Published
Expose a local web service (HTTP + WebSocket) through a hostc tunnel
Maintainers
Readme
hostc CLI
Expose a local HTTP/WebSocket service through a hostc tunnel.
hostc is the thin command-line product layer on top of the hostc client SDK. It handles arguments, config, diagnostics, terminal output, and local service checks. Protocol logic lives in the shared protocol and client packages.
Install
npm install -g hostcOr run it without installing:
npx hostc@latest 3000Usage
hostc <port> [--local-host <host>] [--server <url>] [--data-channels <count>] [--qr]
hostc config get
hostc config set server-url https://hostc.example.com
hostc config unset server-url
hostc config path
hostc doctor [port]Examples
hostc 3000
hostc 5173 --data-channels 4
hostc 8080 --local-host 127.0.0.1
hostc 3000 --server https://hostc.example.com
hostc 3000 --qrOptions
--local-host <host>: host of the local service. Defaults tolocalhost.--server <url>: hostc server URL. Defaults tohttps://hostc.dev.--data-channels <count>: number of binary data channel WebSockets. Defaults to2.--qr: show a QR code for the public URL when stdout is a TTY.
Environment variables
HOSTC_SERVER_URL: override the hostc server URL for local development, staging, or self-hosted deployments.HOSTC_CONFIG: override the config file path.HOSTC_DEBUG: set to1for protocol and reconnect debug output.HOSTC_DISABLE_UPDATE_CHECK: set to1to disable the interactive npm update check.
What it does
- Creates an ephemeral tunnel.
- Opens one or more binary data channel WebSockets.
- Proxies HTTP requests to your local service.
- Proxies WebSocket upgrades on the same local port.
- Recreates a new ephemeral tunnel after a data channel disconnect.
- Prints spinner, success, warning, reconnect reason, and upgrade hints.
- Provides
hostc doctorfor local diagnostics.
Current limitations
- Anonymous tunnels are temporary.
- Reconnects may create a new tunnel id and public URL.
- Reserved domains, accounts, dashboard, and daemon mode are not included yet.
- Early protocol versions may require CLI upgrades.
Links
- Repository: https://github.com/akazwz/hostc
