// use case

Expose your Vite dev server with HMR intact

vite --host opens the LAN; useful at the office, useless for a stakeholder review or testing on a phone over cellular. lrok puts your dev server on a public HTTPS URL with hot reload that still fires.
  1. Run Vite

    $ npm run dev   # http://localhost:5173
  2. Tunnel

    $ lrok http 5173
  3. Whitelist the lrok host in vite.config.ts

    Recent Vite versions reject requests from unknown hosts in dev. Add allowedHosts: ['violet-mole.lrok.io'] (or whatever subdomain you're using) — or 'auto' to accept anything, only fine in dev.

// why lrok for this

HMR is WebSocket-based; lrok forwards WebSocket frames untouched. Some tunnel services break HMR by buffering or aggressively reconnecting. Pin a name with --hint and the Vite allowedHosts entry is permanent.

Related workflows