// use case

Expose your Angular dev server to the internet with a public URL in under a minute.

Angular's default `ng serve` binds to localhost, so teammates, mobile devices, and webhook integrations cannot reach it. Passing `--host 0.0.0.0` opens the port on the local network but still does not produce a routable public URL. Developers searching for a way to share a running Angular app without deploying it need a tunnel.
  1. Start the Angular dev server on a fixed port

    $ ng serve --port 4200
  2. Open a tunnel to that port

    lrok assigns a stable public HTTPS URL that proxies all traffic — including WebSocket connections used by Angular's HMR live-reload — to your local port.

    $ lrok http 4200
  3. Allow the tunnel host in angular.json

    Angular CLI's dev server rejects requests whose Host header does not match an allowed origin. Add your tunnel hostname (or a wildcard) to the `allowedHosts` array inside your project's `serve` configuration in `angular.json`: ```json "serve": { "options": { "allowedHosts": ["all"] } } ``` Alternatively, pass the flag directly: `ng serve --allowed-hosts all`. Without this, every request through the tunnel returns a 403 Invalid Host header error.

// why lrok for this

Angular CLI's dev server proxies WebSocket frames for HMR on the same port as HTTP; lrok tunnels both protocols over a single connection without requiring separate port mappings or custom webpack-dev-server proxy configuration.

Related workflows