3 ms·
I just don't get how this is any better than web sockets, especially using a library like Socket.io. I get the option of 1-way or 2-way communication built in.
by geuis 15y ago
I just don't get how this is any better than web sockets, especially using a library like Socket.io.
I get the option of 1-way or 2-way communication built in. I don't have to worry about reconnects. It falls back all the way to IE5.5. It's usable in a number of languages and frameworks including node.js and Python.
What are the benefits of yet another framework?
- LeafStorm 15y agoFirst, you seem to be confusing WebSockets, which is a protocol and low-level DOM interface for dealing with that protocol with Socket.io, which is a software framework for client-to-server messaging that uses WebSockets as one possible transport. (And pretty much has to take over your server entirely in order to work.) It's like reading an article about Rack and saying, "I don't see how this is any better than Ruby on Rails." Now that that's out of the way: Strictly speaking, WebSockets are "better" than SSE in that you can do everything you can do with SSE using WebSockets. However, the SSE protocol: * Is plain HTTP, instead of adding on a separate protocol, * Has an easy-to-generate text-based format, * Does not require major upgrades to your server, and * Can be emulated on non-conforming browsers using standard XHR's. So when all you need to do in realtime is send data from the server to the client (remember, you can still use XHR's to call back to your server), SSE is far easier to implement both on the client and on the server.