Skip to content

Conversation

@evanqhuang
Copy link

@evanqhuang evanqhuang commented Jul 17, 2025

Summary

Adds support for connecting to remote Playwright browser instances running in Docker containers for better scalability and isolation.

Key Changes

  • Added PlaywrightConfig dataclass with url parameter for WebSocket endpoints
  • Enhanced get_flights() and related functions to accept optional playwright_config parameter
  • Modified Playwright modules to connect to remote instances via playwright.chromium.connect()
  • Updated README with Docker setup instructions and usage examples

Usage

  from fast_flights import get_flights, PlaywrightConfig

  playwright_config = PlaywrightConfig(url="ws://localhost:3000")
  result = get_flights(..., playwright_config=playwright_config)

Docker Setup

  docker run -p 3000:3000 mcr.microsoft.com/playwright:v1.53.0-noble \
    /bin/bash -c "npx playwright install && npx playwright run-server --port=3000"

Benefits

  • now you can run playwright within a docker compose stack for completely headless operation
  • Container isolation: Browsers run in Docker instead of locally
  • Deployment flexibility: Can run browsers on different machines
  • Backward compatible - existing code continues to work unchanged.

Testing evidence:
Screenshot 2025-07-17 at 12 18 25 AM

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Jul 17, 2025
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 9, 2025
@evanqhuang evanqhuang force-pushed the configurable-local-playwright branch from d2098cb to 9c213e9 Compare December 9, 2025 00:42
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant