Title: The registration order of http server listen depends on the Node.js version · Issue #53204 · nodejs/node · GitHub
Open Graph Title: The registration order of http server listen depends on the Node.js version · Issue #53204 · nodejs/node
X Title: The registration order of http server listen depends on the Node.js version · Issue #53204 · nodejs/node
Description: 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...
Open Graph Description: 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 t...
X Description: 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 t...
Opengraph URL: https://github.com/nodejs/node/issues/53204
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The registration order of http server listen depends on the Node.js version","articleBody":"### Version\r\n\r\nv20.13.1\r\n\r\n### Platform\r\n\r\nDarwin 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\r\n\r\n### Subsystem\r\n\r\n_No response_\r\n\r\n### What steps will reproduce the bug?\r\n\r\nThe behavior of `Server.listen` on the same port has changed between node 20.12 and 20.13.\r\n\r\nIf you execute code like the following,\r\nIn 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.\r\nHowever, 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.\r\n\r\n```js\r\nimport { createServer } from \"node:http\";\r\n\r\nconst server = createServer((_, res) => {\r\n res.writeHead(200, { \"Content-Type\": \"text/plain\" });\r\n res.end(\"Hello World\\n\");\r\n});\r\n\r\n// listen order dependents on the version of node.js...\r\nserver.listen(8888, \"127.0.0.1\"); // 20.13 \u003c , this one is used.\r\nserver.listen(8888, \"192.168.10.104\" /* replace your local ip address */); // 20.13 >= , this one is used.\r\n```\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nalways\r\n\r\n### What is the expected behavior? Why is that the expected behavior?\r\n\r\nBoth will be LISTENED to, or if there is a specification for the order, that document will be clearly noted.\r\n\r\n### What do you see instead?\r\n\r\nno outputs\r\n\r\n### Additional information\r\n\r\nFor example, this is how it is used.\r\nhttps://github.com/Azure/static-web-apps-cli/blob/352be8f4ce2d01e1dac17797a80f9f414d612bc0/src/msha/server.ts#L173-L174","author":{"url":"https://github.com/yamachu","@type":"Person","name":"yamachu"},"datePublished":"2024-05-29T17:41:24Z","url":"https://github.com/nodejs/node/issues/53204"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b1569e67-2461-099b-37d6-c4651f139fdb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC36:20C6D9:764631:9D2F5E:6AED24D5 |
| html-safe-nonce | a9eb22ad12fe506932fc2b3fee6e7c077ad9bf6f6b8ccc2c833f4ad6179e868c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzM2OjIwQzZEOTo3NjQ2MzE6OUQyRjVFOjZBRUQyNEQ1IiwidmlzaXRvcl9pZCI6IjUwNDc2NTc3OTUyNzIxMjM2MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | aec88bf520e6d74f9191948e91ed42e2fd632159c872f614e1e6a5bbb11dc0b4 |
| hovercard-subject-tag | issue:2323889701 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/53204/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a9c3bbcb040df93aa5ca46959334d3b137f11a35205564c14379921c55971f85/nodejs/node/issues/53204 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a9c3bbcb040df93aa5ca46959334d3b137f11a35205564c14379921c55971f85/nodejs/node/issues/53204 |
| og:image:alt | 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 t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yamachu |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width