Closed mrazauskas closed 3 years ago
What should be the default value of the host option? Perhaps the same, which is used by listhen?
I think we might ideally support host as array to check both 127.0.0.1 (internal) and 0.0.0.0 (external)
Hosts array as default value. That’s really smart! I will try it out.
At the moment
getPort()
always checks ports on0.0.0.0
.Issue: if some app already listens on
localhost:3000
(rather usual indev
environment),getPort(3000)
will return3000
. It simply checked if0.0.0.0:3000
is free. (Would be good to check, but it sounds similar to issue #3.)Solution: we need a possibility to check
host
andport
combination. In similar situation like abovegetPort({ host: 'localhost' })
would return4000
.What should be the default value of the
host
option? Perhaps the same, which is used bylisthen
?