reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Make websockets optional

Open picklelo opened this issue 3 years ago β€’ 1 comments

We can have a config option to disable websockets and use normal http requests instead.

Advantages:

  • Allow support for certain browsers where websockets aren't supported well
  • May allow for easier deployment in some cases
  • Can support rate-limiting

Disadvantages:

  • We will have to support/test two code paths and make sure we always work with both websockets and http. But since the networking section of the code is pretty contained, this shouldn't be too bad.

picklelo avatar Jan 18 '23 21:01 picklelo

Maybe we can use HTTP as a fallback plan if:

  • Error occured while create Websocket connection ( The browser does not support Websocket or there are something wrong in our backend )
  • Websocket connection broken for a few times ( The network route can't handle it correctly, such as some firewalls )

And we should give our user a way to define which plan to use, maybe a -c / -communication arg with ws, perfer-ws, http?

FHU-yezi avatar Jan 19 '23 00:01 FHU-yezi

Maybe we can close it as #449 already merged.

FHU-yezi avatar Feb 12 '23 21:02 FHU-yezi

Yup we now have fallback to HTTP

picklelo avatar Feb 12 '23 23:02 picklelo