|
|
|
|
|
by endriju
3822 days ago
|
|
I don't think WebSockets belong on a website (even an interactive one as discourse... From the article "Discourse does not use WebSockets. Discourse docker ships with HTTP/2 templates." The whole article is worth reading. It looks like the author is well aware the WebSockets limitations. |
|
The problem is that the appeal of oooh-shiny is so strong that some (many?) developers and influencers do end up "using WebSockets for the wrong thing". Last case I met: a tutorial for a client+server js app using React & Redux [1], building... a CRUD voting application. Quoting the article on why choosing WebSockets for this, "This is an app that benefits from real-time communication, since it's fun for voters to see their own actions and those of others immediately when they occur. For that reason, we're going to use WebSockets to communicate."
Well yes, WebSockets work here (modulo problems and missed benefits/tooling that are the whole point of this article), and socket.io seems like a nice library, but a good old long poll would have done just as well :)
[1] http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial...