-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
ChromeDPClient
hangs when using a WS URL instead of HTTP
#465
Comments
With the val client = ChromeDPClient("http://127.0.0.1:9222", overrideHostHeader = true)
val browserSession = client.webSocket() Check the README for how to get started: https://github.com/joffrey-bion/chrome-devtools-kotlin/tree/main?tab=readme-ov-file#connecting-to-the-browser If you want to use the WS URL directly and save one intermediate HTTP call, you can use the Ktor val httpClient = HttpClient { ... }
val browserSession = httpClient.chromeWebSocket("ws://127.0.0.1:9222/devtools/browser/9e0c7e2a-72a8-4120-8047-c4487f3c1c14") Please let me know if this fixes your issue. |
That being said, it is still a problem that your original code hangs. It should instead fail with an error message that hints towards this solution. So thanks for reporting this, I'll check. |
Thanks! For reference, needed: val client = HttpClient {
install(WebSockets)
install(DefaultRequest) {
headers["Host"] = "localhost"
}
} |
Oh yeah, my bad, the |
ChromeDPClient
hangs when using a WS URL instead of HTTP
Version
6.6.0-1391447
What happened?
This code hangs forever:
Reproduction and additional details
No response
Kotlin target platforms
JVM (non-Android)
The text was updated successfully, but these errors were encountered: