browser-gateway

Quickstart

Install browser-gateway and route your first WebSocket connection in under 5 minutes.

1. Install

npm install -g browser-gateway

Or run without installing:

npx browser-gateway serve

Or via Docker:

docker run -d -p 9500:9500 ghcr.io/browser-gateway/server:latest

2. 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-port

Start 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-usage

3. Start the gateway

browser-gateway serve --config gateway.yml

You 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/connect

4. 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

On this page