Last 12 weeks · 0 commits
4 of 6 standards met
Right now runs a fixed number (6) of attempts over HTTP1 before switching to HTTP2. This causes it to fail to wait for an HTTP1 server which takes a little longer to be up and running. I think it would be better to alternate between HTTP1 and HTTP2 up until the server is running. Since the change is very simple I went ahead and turned it into a PR. Please feel free to edit or reject it if you think this doesn't make sense.
I was confused for a bit why the program was hanging, but eventually profiling with vscode showed an endless loop in wait-for-localhost. Specifically, when the http2 client encounters an error like: then calls the function which calls , which results in the same error again which then calls the function again, and so on...
Repository: sindresorhus/wait-for-localhost. Description: Wait for localhost to be ready Stars: 279, Forks: 12. Primary language: JavaScript. Languages: JavaScript (95.5%), TypeScript (4.5%). License: MIT. Topics: delay, localhost, nodejs, npm-package, server, wait. Latest release: v5.0.2 (3mo ago). Open PRs: 0, open issues: 0. Last activity: 3mo ago. Community health: 71%. Top contributors: sindresorhus, BendingBender, bndnsmth, fehmer, chrisguttandin, danez, Richienb, SamVerschueren, SimonSiefke, vlad-zhukov.