3

I am trying to make the chrome devtools remote debugging feature work (computer to computer).

A month ago it worked on the same setup that I have, but now, with the same configurations (as far as I can remember), it is not working.

This is how the setup looks like:

Remote machine to debug:

chrome.exe --remote-debugging-port=9222

browse to a page and open devools (F12).

Also activate port forwarding in cmd as administrator:

netsh interface portproxy add v4tov4^
    listenport=9222 listenaddress=0.0.0.0^
    connectaddress=127.0.0.1 connectport=9222 

To make sure, I deactivated the firewall.

On the local machine, I go to:

chrome://inspect/#devices

and add the other machine ip:9222 in the "Discover network targets". After a few seconds I can see the machine ip appear as a "Remote Target", but its list is empty

enter image description here

I checked and the remote machine and the port are accessible in the local machine:

enter image description here

Updates

The remote machine is listening on the port:

PS C:\Users\User> netstat -aon | Select-String -Pattern ".*9222.*"

  TCP    0.0.0.0:9222           0.0.0.0:0              LISTENING       4296
  TCP    127.0.0.1:9222         127.0.0.1:49152        TIME_WAIT       0
  TCP    127.0.0.1:9222         127.0.0.1:49153        TIME_WAIT       0
  TCP    127.0.0.1:9222         127.0.0.1:49154        TIME_WAIT       0
  TCP    127.0.0.1:9222         127.0.0.1:49155        TIME_WAIT       0
and many more `TIME-WAIT` rows... (not sure what it means)

On the local machine, I tried using chrome://net-export:

enter image description here

I can see the attempt of the request in green (#1, so maybe means it is good? idk..). There is a UDP error (#2), but is for port 8888 so I am not sure if it is related.

I have put wireshark in the remote machine, filtering on port 9222:

enter image description here

It shows activity, but I am not sure what to check there.

I am trying to add chrome debug.

enter image description here

It says tcp error, but also that devtools is connected on port 9222.

chrome version: 102 (both machines)

How can I debug why it is not connecting?

2
  • Try chrome://net-export. Commented Jun 26, 2022 at 9:49
  • I tried. I can see activity, but I am not sure what it means. I updated the question with more info Commented Jun 26, 2022 at 10:11

2 Answers 2

6

I got it to work. I am not entirely sure what was the issue, but using this script helped: https://gist.github.com/FreaKzero/1f748482fb0315cde713 (not mine).

Also I think it is important to close any chrome instance before running chrome.exe --remote-debugging-port=9222

Sign up to request clarification or add additional context in comments.

2 Comments

Closing existing browser instances is the key.
I see the script you used do interface portproxy add v4tov4 listenport=9222 connectaddress=127.0.0.1 connectport=9222 listenaddress=0.0.0.0 which overcomes the latest chromium limitation to bind to the interface address 0.0.0.0.
2

It is a security "feature" on the latest chrome release: https://issues.chromium.org/issues/41487252

--remote-debugging-address switch presents a security issue and should not be used. We are planning to remove it from the old headless and there are no plans to implement it in the new headless.

If you would like to use it, please report on the chromium issue thread so they can add this feature back.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.