Chrome remote debugging from another machine -


chrome has awesome feature allows open dev tools browser or window. works starting chrome flag:

--remote-debugging-port=9222 

then window/browser can go http://localhost:9222 , open dev tools running tab in chrome. security reasons chrome not allow access machine ip, lets http://192.168.1.2:9222.

however there additional flag indicates opens ability, here chrome has it:

--remote-debugging-address  

use given address instead of default loopback accepting remote debugging connections. should used --remote-debugging-port. note remote debugging protocol not perform authentication, exposing can security risk.

either it's not working or have no idea how format it. have tried 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 supposed ip of remote machine 

the target machine mac

it turned out, option "--remote-debugging-address" can used headless mode ("--headless") , intended used tests when browser runs in docker container , not remote debugging.

the parameter of "remote-debugging-address" must numeric ip-adress of local network interface of machine start chrome "--remote-debugging-address". when using non-local ip-address following errors:

[0526/132024.480654:error:socket_posix.cc(137)] bind() returned error, errno=49: can't assign requested address [0526/132024.480766:error:devtools_http_handler.cc(226)] cannot start http server devtools. stop devtools. 

on mac can start chrome canary version today using command line (the current stable version crashes "--headless"):

/applications/google\ chrome\ canary.app/contents/macos/google\ chrome\ canary  --remote-debugging-port=9222 --remote-debugging-address=192.168.1.20 --headless 

in shell can see, address used listen on socket:

netstat -a -n | grep 9222 tcp4       0      0  192.168.1.20.9222      *.*                    listen    

without "--headless" output this:

tcp4       0      0  127.0.0.1.9222         *.*                    listen 

michael


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -