Skip to content

v0.4.2 — Auto port-shift for npm dev servers behind the proxy

Choose a tag to compare

@thayronarrais thayronarrais released this 11 May 16:37

Highlights

No more collisions when two npm projects share the same configured proxy port. Before, if you set PROXY:3000 on multiple projects, the second one to start would silently land on port 3001 while its vhost still pointed at 3000 — so both *.test hostnames hit the same backend. Now LaraEnv probes upward from the configured port until it finds a free one and rewrites the vhost to follow the real listening port for the lifetime of the run.

What's fixed

Dev server — automatic port collision handling

  • Probe from the configured Proxy portStartDevServer now starts its free-port scan from the project's configured ProxyPort (instead of always from 3000). If that port is free, the dev server uses it and the vhost matches.
  • Slide up on conflict — if the preferred port is held by another LaraEnv dev server or by an external process, the manager increments (3000 → 3001 → 3002 …) until net.Listen succeeds. Up to 200 candidates per start.
  • Vhost follows the real port — when the actual listening port differs from the configured ProxyPort, applyVhostFor regenerates the nginx + Apache vhosts pointing at the live port and reloads the running web server. Two projects with identical PROXY:3000 config now route correctly to their own backends.
  • Vhost restores on Stop — stopping the dev server regenerates the vhost back to the configured ProxyPort so the next manual start uses the intended target.
  • Synchronous Stop bookkeepingManager.Stop now removes the project from its live-process map synchronously after taskkill, so a StartDevServer / applyVhostFor immediately after StopDevServer sees a consistent state instead of a stale "Running" status.

Install

  • Download LaraEnv-0.4.2.msi and double-click.
  • SHA-256 in LaraEnv-0.4.2.msi.sha256.
  • Auto-update from prior versions picks this up automatically.

Compatibility

  • Windows 10+ (x64).
  • No config or data migrations. Drop-in replacement for 0.4.1.