-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The registration order of http server listen depends on the Node.js version #53204
Comments
@nodejs/http |
Reference: Azure/static-web-apps-cli#829 Looking at the changelogs between 20.12.2 and 20.13.0, I don't see anything that directly says it changed this functionality, but the following commit might be of interest: #52492 . I'm not sure, but it's involving DNS ordering, so it might be worth a look. Changelog: https://nodejs.org/en/blog/release/v20.13.0 |
I think this is related to this, this PR makes the last server.listen(8888, "127.0.0.1"); // 20.13 < , this one is used.
server.listen(8888, "192.168.10.104" /* replace your local ip address */); // 20.13 >= , this one is used. |
Ahh that makes more sense |
I didn't even know multiple |
Version
v20.13.1
Platform
Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64
Subsystem
No response
What steps will reproduce the bug?
The behavior of
Server.listen
on the same port has changed between node 20.12 and 20.13.If you execute code like the following,
In node 20.12, 127.0.0.1:8888 (or 0.0.0.0:8888, localhost:8888) is listened to and the
Hello World
string is returned.However, in node 20.13, only 192.168.10.104:8888 is listened to, and the rest, such as 127.0.0.1:8888, are not listened to.
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
Both will be LISTENED to, or if there is a specification for the order, that document will be clearly noted.
What do you see instead?
no outputs
Additional information
For example, this is how it is used.
https://github.com/Azure/static-web-apps-cli/blob/352be8f4ce2d01e1dac17797a80f9f414d612bc0/src/msha/server.ts#L173-L174
The text was updated successfully, but these errors were encountered: