For the More Curious: socket.io WebSockets Library

The ws npm module is a perfectly fine WebSockets implementation. But, admittedly, it is lacking in a few ways. For example, WebSockets connections sometimes get dropped, but the ws module provides no way to automatically reconnect.

Another problem is that ws lives in Node.js. That means that it is only available on the server. In your client-side JavaScript, you would need to learn a totally different library that accomplishes essentially the same task.

On top of that, on the client side you may have additional challenges: What if your browser is old and does not support WebSockets? You would need to provide a fallback mechanism of some kind.

socket.io (socket.io) provides a solution to these problems. For browsers, it provides backward-compatible fallbacks, including a Flash implementation. In addition, it has been ported to a number of other platforms, including iOS and Android.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.150.123