v0.4.2 — Auto port-shift for npm dev servers behind the proxy
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 port —
StartDevServernow starts its free-port scan from the project's configuredProxyPort(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.Listensucceeds. Up to 200 candidates per start. - Vhost follows the real port — when the actual listening port differs from the configured
ProxyPort,applyVhostForregenerates the nginx + Apache vhosts pointing at the live port and reloads the running web server. Two projects with identicalPROXY:3000config now route correctly to their own backends. - Vhost restores on Stop — stopping the dev server regenerates the vhost back to the configured
ProxyPortso the next manual start uses the intended target. - Synchronous Stop bookkeeping —
Manager.Stopnow removes the project from its live-process map synchronously aftertaskkill, so aStartDevServer/applyVhostForimmediately afterStopDevServersees a consistent state instead of a stale "Running" status.
Install
- Download
LaraEnv-0.4.2.msiand 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.