An elastic, session-oriented remote-browser service: the gateway receives API calls from clients, spins up an isolated Chromium instance on the least-loaded worker, and relays the Chrome DevTools Protocol (CDP) stream over a WebSocket.
PostgreSQL records long-lived session metadata, Redis keeps fast-changing state, and MinIO stores optional video or HAR recordings.
| Component | Purpose | Ports (host) |
|---|---|---|
| Gateway | FastAPI REST & WS entrypoint; balances sessions | 8000 |
| Worker | Launches one Chromium per session; CDP proxy | none (internal) |
| Redis | Load balancer, heart-beat, cache | 6379 |
| Postgres | Persistent session log | 5432 |
| MinIO | S3-compatible object store for recordings | 9000 / 9001 |
- Client posts “create session” to the gateway.
- Gateway selects the least-loaded worker from a Redis ZSET and asks it to start a new Chromium process (one per session).
- Worker returns its chosen debug port plus the browser GUID; gateway stores that in Redis and Postgres.
- Client upgrades to WebSocket
/session/{id}; gateway pipes every CDP frame between the client and worker. - A background “sweeper” in the gateway terminates idle or long-running sessions and updates both Redis and the database.
All services run in Docker; no system packages are required beyond Docker Engine + Compose.
docker compose build
docker compose up -dUnit tests target both the CDP proxy and the session machinery.
Insert the Test commands snippet below in the repo root.
pytest -q test_cdp.py
pytest -q test_parallel_validate.py
pytest -q test_parallel.py| Variable | Default | Description |
|---|---|---|
SESSION_TIMEOUT |
3600 s | Hard cutoff per session |
IDLE_TIMEOUT |
300 s | Disconnect after inactivity |
MAX_CONTEXTS |
20 | Max concurrent Chromium per worker |
MINIO_BUCKET |
recordings | Object-store bucket for assets |
Adjust these in docker-compose.yml as needed.
docker compose down -v