fix: use HTTP API to get WebSocket UUID for headless Chrome#73
Open
ghoenixfang-dot wants to merge 2 commits intoeze-is:mainfrom
Open
fix: use HTTP API to get WebSocket UUID for headless Chrome#73ghoenixfang-dot wants to merge 2 commits intoeze-is:mainfrom
ghoenixfang-dot wants to merge 2 commits intoeze-is:mainfrom
Conversation
added 2 commits
May 3, 2026 12:44
When Chrome is started with --remote-debugging-port, the DevToolsActivePort file is not created, causing cdp-proxy to connect to /devtools/browser without UUID, which fails in headless mode. This fix queries the Chrome HTTP API at /json/version to get the actual WebSocket URL with UUID.
- Added docs/PR-73-WEBSOCKET-UUID-FIX.md with detailed analysis - Documented problem, solution, test results, and environment - Linked to PR: eze-is#73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix for CDP proxy connection failure when Chrome is started with
--remote-debugging-portin headless mode.Problem
When Chrome is started with
--remote-debugging-port, theDevToolsActivePortfile is not created. This causescdp-proxy.mjsto fall back to connecting to/devtools/browserwithout a UUID, which fails in headless mode (connection closes immediately with code 1006).Solution
After detecting an open Chrome debugging port via TCP, query the Chrome HTTP API at
http://127.0.0.1:{port}/json/versionto get the actualwebSocketDebuggerUrlcontaining the UUID. Use this UUID path for the WebSocket connection.Changes
getWsPathFromHttpApi()function to query Chrome's JSON version endpointdiscoverChromePort()to use HTTP API fallback when DevToolsActivePort is unavailableTest Result
Generated with Claude Code