logux/docs

Why logux use WebSocket for transport layer?

mesilov opened this issue · 4 comments

Why logux use WebSocket for transport layer?

In PHP-world we have a new thing – https://github.com/dunglas/mercure based on server-sent events.

See article «Using SSE Instead Of WebSockets For Unidirectional Data Flow Over HTTP/2»

Now Symfony introduce Mercure support.

ai commented
  1. SSE doesn’t support by Edge https://caniuse.com/#search=Server-sent%20events
  2. Using different protocols to income and outcome message make the code more complicated.
  3. You do not need Web Socket support from your backend to work with Logux. Logux provides your WS proxy server to convert WS events to HTTP calls. It will give you better performance on languages without good concurrency (like Ruby or PHP).
  4. If you really a big fan of SSE you can use them as well. Both client and server accept Connection object. You can implement any communication way. Web Socket is just a default choice.
ai commented

This article is not really good at comparing WS and SSE.

For instance, using WSS (WS over TLS, “HTTPS” for WS) will save you from any problem with proxies.

ai commented

I will keep your issue open to remind me of creating a separated article about WS vs SSE in docs.

ai commented

Closing it for now since we have a plans to add HTTP support logux/logux#4