3 ms·
Since almost all platforms support Websocket, is it necessary to use Socket.io?
by Thaxll 12y ago
Since almost all platforms support Websocket, is it necessary to use Socket.io?
- elisee 12y agoOn top of its transport layer abstraction, socket.io adds various useful features including events, rooms, namespacing, efficient/convenient (de)serialization and network callbacks. I've been using it in websockets-only mode for various projects, because I don't care for slower / less reliable transports but still want the extra features.
- jeffasinger 12y agoWhile Websocket has good supports by browsers, it doesn't always handle switching between networks correctly, also, some networks disallow Websockets altogether, or drop websocket connections over HTTP, but not over HTTPS. Socket.io (especially > 1.0) solves these issues with a layer by having smart reconnection mechanisms and starts by connecting over plain old HTTP longpolling, and upgrades the connection to use websockets if they're available and work.
- dj2stein9 12y agoIt's not. There's an under-appreciated NPM module which is/was shared by Socket.IO that only handles the low-level WebSocket protocol for NodeJS: https://www.npmjs.com/package/websocket.io https://www.npmjs.com/package/websocket.io You can use that, and the built-in WebSocket object in modern browsers.