Wednesday 25 December 2019

Websocket doubts

Hi! I'm getting deeper in websockets and in my research I found this:- websocket is a standard now with full browser support, so we can just use ws and let our clients connect with native API for websocket.Pros:* Plain native solution* Clients could use a lot of alternative libsCons:* We have to write our own boilerplate code in order to get a full solution with reconnect, disconnect detection, rooms, heartbeat, in server and each client. This is even suggested in ws documentation.- Socket.io is a battle tested socket solutionPros:* Oficial client for Java, Swift, etc.* A lot of plugins, docs and community.* Support all the weird scenarios: load balancers, proxies, etc.Cons:* Adds delay on initial connection because a custom protocol (polling and upgrade to websockets)* A little unmantained (a lot of unresolved issues and last publish 3 months ago)- Sockjs is a very very popular socket solution, I could not understand why.Pros:* Support all the weird scenarios: load balancers, proxies, etc.Cons:* Without oficial client for Java, Swift, etc.Questions+ Could you tell me if I'm wrong or I'm missing something?+ Why sockjs is getting more installs than socketio when sockjs doesn't have Java/Swift clients? How could you use sockjs if you can't use it in your mobile apps? Even in hybrids apps you have to write/use native code/modules in order to have a background service.* Why ws is getting more installs than every body when you have to write your own boilerplate for each one (server, web, android, ios)?Here the comparision

Submitted December 25, 2019 at 11:43PM by dengue8830

No comments:

Post a Comment