ERR_CONNECTION_REFUSED (localhost:3000 only w/ignoreHTTPSErrors)
See original GitHub issueIt’s really hard to debug puppeteer, at least connection errors. Related to #822, I get a ERR_CONNECTION_REFUSED
error. Even with DEBUG=*
, there’s nothing in the puppeteer logs that shows why the request failed. No stack trace, no weird error, no output from my server, nothing. The only output in Chromium inspector console and puppeteer CLI debug output was ERR_CONNECTION_REFUSED
as mentioned.
I also tried the link in Chrome Canary and Chromium on its own, worked OK.
Also, I noticed that I have to manually unset the following header, even though I had set ignoreHTTPSErrors: true
; shouldn’t this header get removed if this option is true
by default?
page.setExtraHTTPHeaders({ 'upgrade-insecure-requests': '0' });
I think that this is a localhost
or a port
issue. My server is running at http://localhost:3000
and I have ignoreHTTPSErrors: true
option set as mentioned.
I changed the URL I’m navigating to with our production URL and it worked fine.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Hey @niftylettuce how you fixed it? I couldn’t make it work successfully. I look over all the issues, but none of the solutions resolve the problem.
In my case, I forgot that the application is running in VS Code dev container and localhost is not visible from the container. I have to replace “localhost” with “host.docker.internal”.