I\'m trying to remote debugg a chrome instance using the remote debug option in chrome:
chrome.exe --remote-debugging-port=1337
as describe
recent Chrome versions support the commandline switch "--remote-debugging-address" so the workarounds listed above should no longer be necessary.
Here the description: "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 re-mote debugging protocol does not perform any authentica-tion, so exposing it too widely can be a security risk."
You can create simple TCP proxy with netcat:
EXTERNAL_PORT=1338
CHROME_DEBUG_PORT=1337 # This is the port specified with --remote-debugging-port
nc -l -p ${EXTERNAL_PORT} -c "nc 127.0.0.1 ${CHROME_DEBUG_PORT}"
Start the headless server
chrome.exe --remote-debugging-port=9222
Set up Port forwarding on windows
netsh interface portproxy add v4tov4^
listenport=9222 listenaddress=0.0.0.0^
connectaddress=127.0.0.1 connectport=9222
You can setup an SSH tunnel in order to debug remotely. On the source machine execute:
ssh -L 0.0.0.0:9223:localhost:9222 localhost -N
Then on the other machine point Chrome browser to http://source-machine-ip:9223
The following worked for me when running a Chrome remote debugging host on Windows 8.
9222
(Click Next)Chrome Remote Debugging (9222)
(Click Finish)Run Chrome on the Windows host:
chrome.exe --remote-debugging-port=9222
Set up port forwarding on the Windows host:
Open up a cmd
window. You must "Run as administrator".
Enter the following into the cmd window:
netsh
interface
portproxy
add v4tov4 listenport=9222 connectaddress=127.0.0.1
On the client, navigate to http://THE_HOST_IP_ADDRESS:9222
and you should be presented with a list of "Inspectable Pages".
I don't think Chrome accepts connections from outside of localhost (for security reasons). I would suggest you have to build small proxy on the same host where Chrome is.