Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
For a browser launched by Puppeteer, call browser.wsEndpoint() to get its WebSocket endpoint. Save the returned string if you need to reconnect, then pass it as browserWSEndpoint to puppeteer.connect(). The endpoint is a browser connection address, not the URL of a page open in that browser.
Get the endpoint from a Puppeteer-launched browser
After launching the browser, call wsEndpoint() on the returned browser object. Puppeteer documents the endpoint format as ws://HOST:PORT/devtools/browser/<id>. See the Puppeteer Browser.wsEndpoint() API.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const browserWSEndpoint = browser.wsEndpoint();
console.log(browserWSEndpoint);
// Disconnect this client without closing the browser.
await browser.disconnect();
// Attach to the still-running browser.
const browser2 = await puppeteer.connect({browserWSEndpoint});
console.log(browser2.wsEndpoint());
// Close the browser when you are finished with it.
await browser2.close();
Use this pattern when the browser is started through Puppeteer and you want to hand its connection address to another part of your program or reconnect after disconnecting. The official Browser API distinguishes disconnect(), which leaves the browser running, from close(), which closes it. The browser management guide documents saving the endpoint and reconnecting.
Free tools Windows power users keep installed
One-click scans. No signup required.
Get the endpoint from a browser started elsewhere
If Chrome was started independently, check its startup output for a debugger WebSocket address when available. Another route is to request http://HOST:PORT/json/version from the browser’s debugging endpoint and read the webSocketDebuggerUrl field. Pass that value to Puppeteer as browserWSEndpoint:
#1 Best Overall
import puppeteer from 'puppeteer';
const browserWSEndpoint = 'ws://HOST:PORT/devtools/browser/ID';
const browser = await puppeteer.connect({browserWSEndpoint});
console.log(await browser.pages());
Replace the example address with the actual webSocketDebuggerUrl returned by your browser. Puppeteer’s connect API documents the connection option; the browser management guide describes attaching to an existing browser.
Know which URL you need
- Browser WebSocket endpoint:
browser.wsEndpoint()returns the address Puppeteer uses to attach to the browser. Its documented shape isws://HOST:PORT/devtools/browser/<id>. - Page URL: A page’s address, such as
https://example.com, identifies the website loaded in a tab. It is not the browser connection endpoint. Connection.url(): This similarly named API returns a string, but its documentation does not give the same browser-level explanation or endpoint format. For the URL that connects to the browser, useBrowser.wsEndpoint(). See the Connection.url() API.
WebSocket versus pipe connections
The endpoint method applies when the browser connection uses a WebSocket. Puppeteer also supports launching Chrome with pipe: true, which uses a pipe rather than a WebSocket. In that case, do not assume a WebSocket URL is available; the cited LaunchOptions documentation establishes the pipe transport but does not describe a URL equivalent for it.
Rank #2
Troubleshoot endpoint and reconnect problems
wsEndpoint()is not a function: Confirm that the value is the browser object returned bypuppeteer.launch(), not a page, target, or connection object.- Reconnect fails: Make sure the original browser process is still running and that you passed the full WebSocket endpoint, including its host, port, and
/devtools/browser/...path. A disconnected Puppeteer client does not itself keep a browser process alive. - Endpoint is missing from
/json/version: Confirm you queried the browser’s debugging host and port and inspect the response forwebSocketDebuggerUrl. The endpoint applies to the browser’s debugging connection, not a normal website URL. - No WebSocket endpoint is available: Check whether the browser was launched using pipe transport. Puppeteer’s launch options support
pipe: true, which is not a WebSocket connection.
Or skip the browser setup
If your goal is simply to capture a website rather than attach automation to a browser, ScreenshotNeo returns a screenshot or PDF from one GET request. See the ScreenshotNeo API docs.
Quick Recap
Best Value
- Used Book in Good Condition
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

