I wonder what are the major differences between Websockets and Socket.io.
Also I wonder which platforms support these two natively?
socket.io is an open source library by Guillermo Rauch. This library tries to find some way of setting up chat-like capabilities between the browser and the server.
websocket is a particular interface found in some modern HTML5 browsers.
http://caniuse.com/#search=websocket shows that neither IE9 nor Android Browsers (2.1-4.2) have websocket support.
http://socket.io/#browser-support claims socket.io will work with IE5.5+
While socket.io will use websocket if it is available, it will also try flash, or even polling. So socket.io has more graceful degradation.
So as to your specific questions:
Performance - Since socket.io tries to use websocket, the speed issue is not so critical but the question is more what to do when someone doesn't have websocket. In that case socket.io, as an abstraction that tries various methods, is more flexible and can use older or slower methods if you are willing to permit that within the application.
Applications -- they are both useful for "chat" style systems and passing around data in real time. socket.io's author claims to have additional functionality over websocket, see http://socket.io/#faq
Support - Since websocket is in the browser, there is nothing to support. In comparison, socket.io is an open source library, and the issues page at https://github.com/learnboost/socket.io/issues shows active, though not instant, attention to bugs and questions. If you have code that you have tried, and want to ask why it does not work, Stack Overflow would be a good place to ask. If you want code, without any work on your part, try google. A number of people have given away examples on their blogs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With