andrewvy/chrome-remote-interface

Cannot connect to remote chrome (docker-compose)

Opened this issue · 1 comments

Hi,

I have chrome running as docker image with docker-compose.

If I try to connect to exposed to local machine port - it works fine, however if I try to connect using "compose" URL as host, getting just false.

Any hints?

I'm connecting like this:

    server = ChromeRemoteInterface.Session.new(host: "chrome")
    {:ok, pages} = ChromeRemoteInterface.Session.list_pages(server)

Getting this:

im_1  | ** (exit) an exception was raised:
im_1  |     ** (MatchError) no match of right hand side value: false

Docker image with chrome correctly expose needed default port. As I mentioned above, using host machine works fine.

@solshark try looking @ https://github.com/holsee/chroxy which runs chrome as a service (now including a Dockerfile see the README) and has a convenient mechanism through https://github.com/holsee/chroxy_client to obtain chrome endpoints which can be connected to using ChromeRemoteInterface (this project). This might be of use to you.
This video might be useful too: https://www.youtube.com/watch?v=FGUEDu8A7GY (although was made before Chroxy got a Dockerfile).