-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Support --headless=new #225
Comments
Until the Chromium team fixes this issue upstream, and for those who need a hacky workaround, you can always use socat (or anything similar) to forward to the debugging port which is only exposed on localhost inside the container: wrap.sh: #!/bin/sh
chromium-browser --headless=new --remote-debugging-port=9221 "$@" &
socat TCP-LISTEN:9222,fork,reuseaddr TCP:127.0.0.1:9221 Dockerfile: FROM zenika/alpine-chrome:112
USER root
RUN apk add --no-cache socat
USER chrome
COPY wrap.sh .
ENTRYPOINT ["sh", "wrap.sh"] When running the container, I can reach
The good thing is that the field |
It's an old issue, but I have found workaround with host header
then connect with WebSocket
docker-compose service
if you are using kubernetes
|
@mrm-ot I am not quite able to follow what your solution does if the connection is failing from a remote host? Spoofing the host header doesn't seem to be something that's working. Are you running your script from within the same container? would love to understand your fix a bit more! @sfcgeorge were you able to find an elegant solution in the end? |
Describe the bug
Chrome has a new headless mode! https://developer.chrome.com/articles/new-headless/
The old mode is
--headless
, the new one is--headless=chrome
in v108 and below (current Zenika version) or--headless=new
in subsequent versions.From within the container it seems to work fine
docker compose exec chrome wget -O- http://localhost:9222/json/list
But from another container I get "Connection refused"
docker compose exec web wget -O- http://chrome:9222/json/list
To Reproduce
Based on this issue #158 I think it's
--remote-debugging-address=0.0.0.0
not working, which would be a Chrome bug, so I've reported it there https://bugs.chromium.org/p/chromium/issues/detail?id=1427419I'm opening the issue here for others to find or in case I'm wrong and there's some other magic flag that would fix it.
The new mode will become default one day and eventually the old mode will be removed.
Possible solution
Tried various flag incantations with no change.
Logs
Chrome logs (setting
--user-data-dir
doesn't fix this):Versions
Additional context
This whitelisted-ips setting also sounded promising but I don't think that's it #198
The text was updated successfully, but these errors were encountered: