Skip to content

Support running DWDS without a Chrome Debug Port (web-socket-based) #2639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jyameo
Copy link
Contributor

@jyameo jyameo commented Jun 26, 2025

  • Implemented a WebSocket-based communication protocol that provides essential developer tooling (hot reload, service extensions) when Chrome debugger access is unavailable. - #2605
  • Added WebSocket-based hot reload and service extension support via new WebSocketProxyService class that implements VM service protocol over WebSockets.
  • Created new files: WebSocketProxyService, WebSocketDebugService, WebSocketAppDebugServices, and WebSocketDwdsVmClient to support socket-based DWDS functionality.
  • Enhanced DevHandler with useWebSocketConnection flag to toggle between Chrome-based and WebSocket-based communication protocols.

related to #2605
- This setup currently works when launching from the terminal using the -d web-server flag. The app starts as expected, loads correctly, and hot reload functions properly.

WIP / Pending Implementation:

  • Page refresh from IDEs still has some issues
  • Missing test cases

Changes needed in Flutter Tools

// Change this:
bool get deviceIsDebuggable => device!.device is! WebServerDevice || debuggingOptions.startPaused;

// To this:
bool get deviceIsDebuggable => 
    device!.device is! WebServerDevice || 
    debuggingOptions.startPaused ||
    _useDwdsWebSocketConnection;

// And add this getter:
bool get _useDwdsWebSocketConnection {
  if (device?.devFS is WebDevFS) {
    return (device!.devFS! as WebDevFS).useDwdsWebSocketConnection;
  }
  return false;
}

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

Successfully merging this pull request may close these issues.

1 participant