jeffbski / wait-on

wait-on is a cross-platform command line utility and Node.js API which will wait for files, ports, sockets, and http(s) resources to become available
MIT License
1.87k stars 77 forks source link

Feature request - wait for: either url #128

Open MattBidewell opened 2 years ago

MattBidewell commented 2 years ago

A nice to have would be the ability to OR URLs.

One implementation could be: wait-on (tcp:[::1]:80 tcp:127.0.0.1:80)

Alternatively, it could be pure config.

If I've misread the docs and this already exists, then my apologies.

Issue I'm solving: Since updating to Node17+. Node DNS lookups return IPv6 first. Which might not seem like a massive issue, but localhost URLs are now in theory [::1]:{port} rather than 127.0.0.1:{port}

My current project is using wait on like so - wait-on localhost:5000 localhost:5001 and will hang as the servers are starting on [::1]:5000 ... etc..

metcoder95 commented 2 years ago

Adding my two cents, I think would be better to make wait-on do listen on both IPv by default when it encounters a localhost origin within the resources passed through, at least until https://github.com/nodejs/node/pull/44731 gets merged.

But the OR feature will be indeed a good addition.