dart /
webdev /
8847f2507d9d72c17eed5a65df738bbb912ceda6 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