Skip to main content
chromedp attaches to a Surfsky browser through a remote allocator with the session’s ws_url. The browser runs in Surfsky’s cloud; no local Chrome is needed.

Prerequisites

Go 1.22 or newer. Set your API token and base URL, then create a project:
The example starts a browser with an empty request body, which uses your account’s default proxy pool. Proxy, fingerprint, and other start options are in the API reference.

Run an example

The example starts a one-time browser, connects, opens a page, prints its title, and stops the session through the API. To keep cookies and login state between runs, start a persistent profile instead; the connection code is the same. Save as main.go:
Expected output:
chromedp.NoModifyURL keeps Surfsky’s WebSocket address as returned. Without it chromedp rewrites the URL and the connection fails.

Stop the session

Stop the session through the API with the internal_uuid from the start response, like the deferred stopSession above. chromedp.Cancel(ctx) and the cancel functions only disconnect. chromedp sends Browser.close only for browsers it launched itself, so the remote browser keeps running until you stop it or the inactivity timeout expires. Register the stop before you connect, so error paths hit it too, and avoid log.Fatal, which skips deferred calls. The same request from the shell:
Otherwise the browser stops after the inactivity timeout, 30 seconds by default.