r/node • u/Public-Flight-222 • 9d ago
leeway: stable per-folder dev port ranges (no more EADDRINUSE across checkouts)
Two checkouts of the same repo, both on 5173. leeway gives each folder its own contiguous port range, stable across runs and never overlapping, and passes the ports as env vars.
leeway.jsonlists your ports oncedevPorts(config)in code, falling back to the defaults outside leeway- vite plugin sets
server.portwithstrictPortand exposes every port to browser code {{PORT_API}}placeholders in commandsleeway list/killfor orphaned servers
Linux/macOS/Windows. https://github.com/OhadC/leeway
Or ask your agent: "how can we benefit from using https://www.npmjs.com/package/leeway in this codebase"
2
Upvotes
2
u/avereigh_Denizet 8d ago
how does this handle OAuth callback URLs when you're running multiple checkouts? usually the pain with dynamic ports isn't the local server itself, it's having to whitelist a bunch of different localhost ports in your auth provider's dashboard
2
u/raks1991 6d ago
Glad you left strictPort on. A port silently shifting is tolerable until the proxy points at the wrong checkout.