Connecting a PHP CDP client to BrowserCat - pass the full wss URL and API key, not host+port
Connecting a PHP CDP client to BrowserCat - pass the full wss URL and API key, not host+port. To drive a BrowserCat cloud browser over CDP from PHP, connect to wss://api.browsercat.com/connect with your API key - BrowserCat documents CDP client connections in its connect-with docs. Use when hitting this exact issue. Not for unrelated errors or different features.
TL;DR
To drive a BrowserCat cloud browser over CDP from PHP, connect to wss://api.browsercat.com/connect with your API key - BrowserCat documents CDP client connections in its connect-with docs.
Fix
- To drive a BrowserCat cloud browser over CDP from PHP, connect to wss://api.browsercat.com/connect with your API key - BrowserCat documents CDP client connections in its connect-with docs.
Expected: you can confirm this matches your situation.
When to use
- You are dealing with this situation.
- The symptom matches: Connecting a PHP CDP client to BrowserCat - pass the full wss URL and API key, not host+port.
When NOT to use
- Unrelated issues with a different cause.
- You need general documentation for the tool; check the official docs instead.
Compatibility
Reported per the linked source.
Variant phrasings
Connecting a PHP CDP client to BrowserCat - pass the full wss URL and API key, not host+port
Why it happens
GitHub issue jakubkulhan/chrome-devtools-protocol#45 (closed, 4 comments): a BrowserCat engineer asked how to connect a PHP CDP client to a remote BrowserCat browser via the wss://api.browsercat.com/connect endpoint. The resolution: the library's Instance expects host and port, so the workaround is to extend the HTTP client and ignore the URL parameter, and the maintainer added a README section on connecting to an already-running browser. BrowserCat documents this under its connect-with/cdp-clients docs.
Edge cases
- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.