Skip to content

Commit cd9c593

Browse files
committed
Add guidance about CDP connections and retrying
1 parent 1e55408 commit cd9c593

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

browsers/create-a-browser.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ finally:
100100
```
101101

102102
</CodeGroup>
103+
104+
105+
## Connection notes
106+
- **CDP connections** are meant to be long-lived but may eventually close. Websocket connections typically can remain active for up to 1 hour, after which they may close automatically. Browser sessions themselves are unaffected—reconnect to the same `cdp_ws_url` to continue using the browser.
107+
- Browsers persist independently of CDP. Depending on your browser [persistence](/browsers/persistence) or [timeout](/browsers/termination#timeouts-for-non-persisted-browsers) configuration, it will continue running even if the CDP connection closes. You can reconnect to the same `cdp_ws_url` if you're unexpectedly disconnected.
108+
- We recommend implementing reconnect logic, as network interruptions or lifecycle events can cause CDP sessions to close. Detect disconnects and automatically re-establish a CDP connection when this occurs.

0 commit comments

Comments
 (0)