-
Notifications
You must be signed in to change notification settings - Fork 616
feat: Support remote CDP connections and WebSocket protocol #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 支持通过完整 URL 连接到远程 CDP 端点 - 支持 ws:// 和 wss:// WebSocket 协议 - 保持向后兼容,端口号仍然支持本地连接 - 更新类型定义和协议验证以支持多种 URL 格式
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2a8c0b18f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (val) => { | ||
| // Accept port numbers as strings, or full URLs | ||
| if (/^\d+$/.test(val)) { | ||
| const port = parseInt(val, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cdpPort: z.number().positive().optional(), | ||
| cdpPort: z | ||
| .union([ | ||
| z.number().positive(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Check if string is numeric and treat it as port number - Convert numeric strings to http://localhost:port format - Fixes runtime regression for JSON callers that serialize ports as strings
|
Fixed the issue with numeric-string The code now checks if a string is numeric (e.g., |
When JSON callers serialize port numbers as strings (e.g., "9222" instead of 9222), the CDP connection should still work correctly. Added explicit regex check for numeric strings to handle this edge case gracefully. Inspired by PR vercel-labs#110's approach to handling this scenario. Co-Authored-By: Claude Opus 4.5 <[email protected]>
When JSON callers serialize port numbers as strings (e.g., "9222" instead of 9222), the CDP connection should still work correctly. Added explicit regex check for numeric strings to handle this edge case gracefully. Inspired by PR vercel-labs#110's approach to handling this scenario. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Similar logic already merged: #99 |
Feature Description
This PR adds support for remote CDP connections and WebSocket protocol.
Key Changes
Usage Examples
Modified Files
src/types.ts- Updated type definitions to support string | numbersrc/protocol.ts- Updated protocol validation to support multiple URL formatssrc/browser.ts- Updated connection logic to support remote and WebSocket connectionscli/src/main.rs- Updated CLI argument parsing to support URL formatsTesting