Windows Shared Chrome Debugging Method
Categories:
Need to share a public Chrome browser for multi-device debugging, avoiding repeated logins across multiple places.
# chrome启动命令
& "C:\Program Files\Google\Chrome\Application\chrome.exe" `
--remote-debugging-address=127.0.0.1 `
--remote-debugging-port=34037 `
--user-data-dir="M:\chrome-remote"
Note especially here that, for security reasons in new versions of Chrome, exposing Chrome to 0.0.0.0 is no longer supported, and remote-debugging-address does not actually take effect.
# 增加防火墙放行规则:
netsh advfirewall firewall add rule name="Chrome DevTools 34037 LAN" dir=in action=allow protocol=TCP localport=34037
# 建立 portproxy(系统层反代):
netsh interface portproxy add v4tov4 listenport=34037 listenaddress=192.168.31.2 connectport=34037 connectaddress=127.0.0.1
# 清掉portproxy 规则
# netsh interface portproxy reset
# 测试生效
curl http://127.0.0.1:34037/json/version
curl http://192.168.31.2:34037/json/version