windows 공유 디버깅 chrome 방법

공용 Chrome 브라우저를 여러 엔드에서 디버깅할 수 있도록 공유해야 하며, 반복적인 여러 곳 로그인을 피합니다.

# 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"

여기서 특히 주의할 점은, 새 버전 chrome은 보안 고려사항으로 chrome을 0.0.0.0에 노출하는 것을 더 이상 지원하지 않으며, remote-debugging-address는 실제로 작동하지 않습니다.

# 增加防火墙放行规则:
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