Chrome has a really awesome feature that allows you to open the dev tools from another browser or window. It works by starting chrome with this flag:
--remote-debugging-port=9222
Then from another window/browser you can go to http://localhost:9222 and open dev tools for any running tab in Chrome. For security reasons Chrome will not allow access from another machine by IP, lets say http://192.168.1.2:9222.
However there is an additional flag that indicates it opens this ability, here is what Chrome has to say for it:
--remote-debugging-address 
Use the given address instead of the default loopback for accepting remote debugging connections. Should be used together with --remote-debugging-port. Note that the remote debugging protocol does not perform any authentication, so exposing it too widely can be a security risk.
Either it's not working or I have no idea how to format it. I have tried the following:
--remote-debugging-port=9222 --remote-debugging-address=http://192.168.1.2:9222
--remote-debugging-port=9222 --remote-debugging-address=http://192.168.1.2
--remote-debugging-port=9222 --remote-debugging-address=192.168.1.2:9222
--remote-debugging-port=9222 --remote-debugging-address=192.168.1.3 //maybe thinking its supposed to be the IP of the remote machine
The target machine a Mac
- 
 Should probably just be the IP address the other machine can connect by. Adding a port would be redundant.Alexander O'Mara– Alexander O'Mara2016年11月10日 22:38:23 +00:00Commented Nov 10, 2016 at 22:38
 - 
 In example 4 you can see I tried thatSean256– Sean2562016年11月10日 23:34:23 +00:00Commented Nov 10, 2016 at 23:34
 - 
 Example 4 actually shows you tried specifying the address of the remote machine. Not the local one... I believe Alex meant this: --remote-debugging-port=9222 --remote-debugging-address=192.168.1.2 and I want to suggest this as a possibility too: --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0JoshG– JoshG2017年02月28日 08:09:11 +00:00Commented Feb 28, 2017 at 8:09
 - 
 Nothing works also here (chromium in debug mode is in raspberry / linux), remote browser on a mac, through a VPNDamien C– Damien C2021年01月13日 10:03:10 +00:00Commented Jan 13, 2021 at 10:03
 
5 Answers 5
it turned out, that the option "--remote-debugging-address" can only be used for the headless mode ("--headless") and is intended to be used for tests when the browser runs in a docker container and not for remote debugging.
The parameter of "remote-debugging-address" must be the numeric ip-adress of a local network interface of the machine where you start Chrome with "--remote-debugging-address". When using any non-local ip-address you will get the following errors:
[0526/132024.480654:ERROR:socket_posix.cc(137)] bind() returned an error, errno=49: Can't assign requested address
[0526/132024.480766:ERROR:devtools_http_handler.cc(226)] Cannot start http server for devtools. Stop devtools.
On my Mac I can start the Chrome Canary version from today using this command line (the current stable version just crashes with "--headless"):
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --remote-debugging-port=9222 --remote-debugging-address=192.168.1.20 --headless
In another shell you can see, that this address is used to listen on the socket:
netstat -a -n | grep 9222
tcp4 0 0 192.168.1.20.9222 *.* LISTEN 
Without "--headless" the output will look like this:
tcp4 0 0 127.0.0.1.9222 *.* LISTEN
Michael
3 Comments
--remote-debugging-port=9222 on the remote machine and ssh -L 9222:localhost:9222 user@host on the local machine. Then you would connect to localhost:9222 on local to access remote's Dev Tools.--remote-debugging-address is semantically different from chromedriver's --whitelisted-ips
The remote debugging address must specify the address to bind to. So what you want in there is your machine's IP address not the address you will be connecting from. Try binding to all interfaces with --remote-debugging-address=0.0.0.0
Comments
Try create a HTTP-proxy in your target machine.
httpProxy
 .createServer({
 target: wsurl,
 ws: true,
 localAddress: host
 })
 .listen(port);
works for me.
3 Comments
Chrome has removed the "--remote-debugging-address" flag, it appears.
Comments
One way to get it to work with docker, is to use socat.
setup chrome, so it will start debugging on port 9222, for example
chrome_options.add_argument("--remote-debugging-port=9222")install socat in the docker container (before hand, or later if you want, yum install socat)
then run start docker with
docker run -p 9222:9223 -it <my_image> chrome...
#This binds port 9223 of the container to port 9222 on 127.0.0.1 of the host
- then in a second window, enter the same docker container, just started
 
docker exec -it <container_just_started> bash
# or if there is only 1 running container
docker exec -it $(docker ps --format "{{.Names}}") bash
you can verify chrome is exposing 9222 inside the container by running, the following:
curl http://127.0.0.1:9222/jsonin this container, run the following socat command, (listen to traffic on 9223 and send it to 9222 inside the container)
socat TCP-LISTEN:9223,fork TCP:127.0.0.1:9222running, the following on the docker host should now work
curl http://128.0.0.1:9222/jsonYou can now inspect inside of chrome using by going to
chrome://inspect/#devices