Re:Building multiplayer games with Socket.io and HTML5 Canvas
by oboopfmlrmnmn on Saturday September 23, 2017 @10:01AM
(#15319750)
Just wondering, why are people still using socket.io and not standard websockets, as available in every browser since several years now?
[ Parent
| on HN ]
Re:Building multiplayer games with Socket.io and HTML5 Canvas
by XCSme on Saturday September 23, 2017 @11:48AM
(#15320239)
If you don't mind performance, using socket.io gives you stay-alive on the ws connection. If you don't mind writing the 5 lines of code it takes to implement stay-alive for normal websockets then socket.io makes no sense anymore.
Re:Building multiplayer games with Socket.io and HTML5 Canvas
by emilsedgh on Saturday September 23, 2017 @07:12PM
(#15322284)
I'm personally using it because it gives me:
1. Rooms
2. Disconnects and reconnects,
3. Fallack solutions
for free.
Although not for a game. I trust that its just not made for that kind of performance.
But for a messaging app its actually quite decent.
Re:Building multiplayer games with Socket.io and HTML5 Canvas
by gbuk2013 on Saturday September 23, 2017 @06:44PM
(#15322192)
It provides fallback connection methods if WS connection fails, as it can do if you have, for example, a HTTP/1.0 only proxy between you and the client. For example it was not that long ago that nginx did not support proxying HTTP/1.1. It is getting less and less relevant but at least for me the socket.io code has worked for a long time and there hasn't been a need to rewrite it.