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
[Bug]: browserWSEndpoint with localhost path throws ECONNREFUSED error #8873
Comments
So it seems in NodeJS |
Filed crbug.com/1358656 |
Interesting case! I've checked with our Firefox implementation and the |
I'm experiencing this issue too. Not sure how to write a proper test for it (it looks kind of random) |
@Kikobeats you should not have the problem if you only use the IP address |
@OrKoN In my case it was a bug on user-code: I have some logic to automatically reconnect the browser under disconnection and that was keeping the web socket connection forever. Happy to say it's fixed for me 🙂 |
- 🌎 We currently connect to local for tests via 127.0.0.1 - ⛔ This only works for ipv4. Some versions of node, and thus pupeteer, only support ipv6 (see: puppeteer/puppeteer#8873) - ✅ This commit uses localhost instead, which can resolve to either ipv4 or ipv6 as needed.
This is the correct reason if it happens on the newer versions of node.js. I fixed it by replacing |
Bug description
Steps to reproduce the problem:
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
webSocketDebuggerUrl
by opening the following page using localhost:http://localhost:9222/json/version
webSocketDebuggerUrl
value:const browser = await puppeteer.connect({browserWSEndpoint: 'WEBSOCKETVALUE'})
Expected behavior:
Puppeteer connects to existing instance of Chrome.
Actual behavior:
Puppeteer throws ECONNREFUSED error (see output below).
Important Details
ws://127.0.0.1
, which works as expected. But thews://localhost
path has always worked and this change in 17.0.0 broke my existing scripts.Puppeteer version
17.0.0
Node.js version
18.4.0
npm version
8.12.1
What operating system are you seeing the problem on?
Windows
Relevant log output
The text was updated successfully, but these errors were encountered: