Quickstart
Install browser-gateway and route your first WebSocket connection in under 5 minutes.
1. Install
npm install -g browser-gatewayOr run without installing:
npx browser-gateway serveOr via Docker:
docker run -d -p 9500:9500 ghcr.io/browser-gateway/server:latest2. Point at a browser
Save this as gateway.yml:
version: 1
gateway:
port: 9500
providers:
my-chrome:
url: http://localhost:9222 # a Chrome running with --remote-debugging-portStart Chrome for a moment to have something to route to:
docker run -d -p 9222:9222 --shm-size=2g chromedp/headless-shell:latest \
--no-sandbox --disable-dev-shm-usage3. Start the gateway
browser-gateway serve --config gateway.ymlYou should see:
▲ browser-gateway v0.3.6 ready in 2ms
➜ Gateway: http://localhost:9500
➜ Dashboard: http://localhost:9500/web
➜ WS endpoint: ws://localhost:9500/v1/connect4. Connect a client
Any CDP or Playwright client talks to the gateway the same way it talks to a browser directly.
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://localhost:9500/v1/connect",
});
const page = await browser.newPage();
await page.goto("https://example.com/");
console.log(await page.title());
await browser.disconnect();5. Open the dashboard
Visit http://localhost:9500/web, providers, sessions, profiles, replays, live view, config editor all live there.
Next
- Add more providers. Browserless, Steel, Cloudflare Browser Rendering, custom CDP
- Enable profiles: reuse browser state across sessions
- Turn on replay: record every session for later playback
- REST API: screenshots, PDF, content extraction with no client code