unjs / get-port-please

🔌 Get an available open port
MIT License
255 stars 13 forks source link

Auto host fallback #57

Closed pi0 closed 1 year ago

pi0 commented 1 year ago

Context: https://github.com/nuxt/nuxt/issues/20019

When get-port-please is unable to obtain a port, the issue is usually because of a wrong hostname option. In order to improve DX, we shall implement a fallback strategy to try with localhost > 127.0.0.1 and "" (only if explicit public option is provided to avoid unwanted exposure)