Skip to content

Add remote access support with WebSocket proxy and lazy launch#27

Open
alexknowshtml wants to merge 1 commit intoSawyerHood:mainfrom
alexknowshtml:feature/remote-access
Open

Add remote access support with WebSocket proxy and lazy launch#27
alexknowshtml wants to merge 1 commit intoSawyerHood:mainfrom
alexknowshtml:feature/remote-access

Conversation

@alexknowshtml
Copy link

Adds support for running the dev-browser server remotely over a network.

Features

  • host option: Bind server to custom address (use 0.0.0.0 for remote access)
  • WebSocket proxy: Routes CDP connections through the HTTP server, working around Chrome ignoring --remote-debugging-address on macOS
  • lazy option: Delay browser launch until first client request

Environment Variables

  • HOST: Server bind address (default: localhost)
  • LAZY: Set to true for lazy browser launch

Usage

HOST=0.0.0.0 bun run scripts/start-server.ts

Why WebSocket Proxy?

On macOS, Chrome ignores the --remote-debugging-address flag and always binds the CDP WebSocket to localhost. This proxy routes WebSocket connections from the HTTP server port to Chrome's internal CDP port, enabling remote connections.

Tested

  • Remote connections from Linux server to macOS (both Intel and Apple Silicon)
  • Lazy mode startup and immediate mode
  • WebSocket proxy with Playwright CDP connections

Features:
- host option: Bind server to custom address (use 0.0.0.0 for remote access)
- WebSocket proxy: Routes CDP connections through HTTP server, working around
  Chrome ignoring --remote-debugging-address on macOS
- lazy option: Delay browser launch until first client request

Environment variables:
- HOST: Server bind address (default: localhost)
- LAZY: Set to true for lazy browser launch

Usage:
  HOST=0.0.0.0 bun run scripts/start-server.ts
@tiagoefreitas
Copy link

this is awesome @SawyerHood !
been meaning to try this as I also run agents on a linux vps connected to my mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants