HTTP has overhead, sometimes the response body has less characters than the request/response headers of an HTTP request, sound like a waste to me.
Websockets is a pub/sub protocol but Sockets.io have implemented an acknowledgments layer that mimics the request response paradigm, so this could leveraged to create an HTTP like rest interface via persistent socket connection without all the overhead, should hopefully provide better performance.
A request level JSON wrapper could carry the request data like error, data and messages etc.
The server 'on' handlers could wrap its contents with try/catch to specifically handle server errors.
The client could provide all sorts of neat ways of consuming data from these kind of requests like returning observables for specific routes/events
HTTP has overhead, sometimes the response body has less characters than the request/response headers of an HTTP request, sound like a waste to me.
Websockets is a pub/sub protocol but Sockets.io have implemented an acknowledgments layer that mimics the request response paradigm, so this could leveraged to create an HTTP like rest interface via persistent socket connection without all the overhead, should hopefully provide better performance.