I'm working on the client-side of a project with a large and complex server-side component. The client will be deployed as an mobile app among other contexts.
For client-server communication, there are two opposing views:
- Use REST
- Use web sockets
Personally, I don't mind which approach is taken so long as the resulting API is well thought out, understandable and extensible.
From experience with using TCP sockets before on a complex C++-based application, I know that roll-your-own syntax/protocols can quickly get inconsistent, confusing and difficult to manage.
Are there any general purpose styles or protocols, like REST or SOAP, for client-server communication using web sockets? Are there any guidelines or best practices on designing your own client-server communication scheme/protocol?