reflex
reflex copied to clipboard
Make websockets optional
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.
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?
Maybe we can close it as #449 already merged.
Yup we now have fallback to HTTP