Browser-Go is a Chrome DevTools Protocol (CDP) based browser management service that supports multi-user concurrent access and session management.
- Multi-user concurrent access support
- Automatic browser instance lifecycle management
- User session persistence
- Automatic cleanup of inactive instances
- RESTful API interface
- WebSocket connection support
- Node.js 16.0 or higher
- Chrome browser
- Operating System: Windows/Linux/macOS
- Clone the repository:
git clone https://github.com/yattin/browser-go.git
cd browser-go
- Install dependencies:
npm install
node cli.js [options]
Option | Description | Default |
---|---|---|
--max-instances=<number> |
Maximum number of concurrent instances | 10 |
--instance-timeout=<minutes> |
Instance timeout in minutes | 60 |
--inactive-check-interval=<minutes> |
Interval for checking inactive instances in minutes | 5 |
--token=<string> |
Access token | 'browser-go-token' |
--help |
Show help information | - |
# Start with default configuration
node cli.js
# Start with custom configuration
node cli.js --max-instances=5 --instance-timeout=30 --inactive-check-interval=2
# Set custom access token
node cli.js --token=my-secret-token
Launch a browser instance via WebSocket connection:
ws://localhost:3000?token=<token>&startingUrl=<url>&launch=<launch_args>
Parameters:
token
: Access tokenstartingUrl
: URL to open after browser launchlaunch
: JSON format launch parameters (optional){ "user": "user123", // User identifier for session persistence "args": ["--window-size=1920,1080", "--lang=en-US"] // Chrome launch arguments }
GET /api/v1/browser/stop?user_id=<user_id>
GET /api/v1/browser/list
GET /api/v1/browser/stats
Controls the maximum number of browser instances that can run simultaneously. New connection requests will be rejected when this limit is reached.
Maximum survival time for browser instances in inactive state. Instances will be automatically closed after this time.
Time interval for the system to check inactive instances. Adjust this value based on your actual usage.
Token used to authenticate client requests. Use a strong random value in production environment.
- Ensure sufficient system memory for running multiple Chrome instances
- Recommended to use a reverse proxy (e.g., Nginx) for load balancing in production
- Regularly check log files to monitor system status
- Adjust configuration parameters based on actual needs
browser-go/
├── cli.js # Main entry point
├── logger.js # Logging module
├── package.json # Project configuration
└── README.md # Project documentation
- express: Web server framework
- chrome-launcher: Chrome browser launcher
- http-proxy: HTTP proxy
- axios: HTTP client
MIT License