Método para depurar Chrome compartido en Windows
Categories:
Se necesita compartir un navegador Chrome público para depuración multi-end, evitando el inicio de sesión repetido en múltiples lugares.
# 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"
Es importante notar aquí que, por consideraciones de seguridad, las nuevas versiones de Chrome ya no soportan exponer Chrome a 0.0.0.0, remote-debugging-address en realidad no tiene efecto
# 增加防火墙放行规则:
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