Support websockets for injected client (#1275)

This adds support for WebSockets for the injected client.

It does not yet implement any "keepalive". The WebSockets do their own keep-alive to keep the connection alive, but a page refresh will disconnect/reconnect the connection (although that seems to work fine in my testing - I could reload multiple times, and then trigger breakpoints).

I did see a disconnect when testing after leaving it for a while (I was AFK for > 10min), though I haven't done enough testing to fully understand that yet (it could've been the proxy drop it, or it could've been my WiFi). We could always add WS keepalives/reconnections later if this seems to be a problem.

I added a test that the injector is inserting the right scheme, ~~although I couldn't find if there are integration tests that fully test the injected client connection - if there are and you can point me toward some, I can ensure there's coverage using WS too~~. Also added a reload test using WS, and made all tests using `useSse: false` also use WS for the injected client.

(I also haven't updated changelog/versions yet, as I'm not sure when this will be merged/released.)

@grouma this is a requirement for a cloud environment I was testing - they confirmed they do not support SSE (WebSockets are the only requests that will be streamed through the proxy).
12 files changed
tree: d98b244b6613efdb3bbc8e822437aa911916ba9f
  1. .github/
  2. dwds/
  3. example/
  4. fixtures/
  5. frontend_server_client/
  6. frontend_server_common/
  7. tool/
  8. webdev/
  9. .gitattributes
  10. .gitignore
  11. analysis_options.yaml
  12. AUTHORS
  13. CONTRIBUTING.md
  14. mono_repo.yaml
  15. README.md
README.md

Dart

dwds Pub Package

A service that proxies between the Chrome debug protocol and the Dart VM service protocol.

webdev Pub Package

A command-line tool for developing and deploying web applications with Dart.