Skip to content

Application Messages between Client and Server

jmartintoro edited this page Nov 28, 2023 · 3 revisions

Description πŸ“œ

In this page we will describe all the messages that the client send to the Server and viceversa.

Client to Server πŸ“¨

When the client connects to the server, it sends a message indicating its running version to track the number of clients for each version connected simultaneously.

Connection Message Examples:

  • Desktop App: {"type":"connection", "version": "desktop"} πŸ–₯️
  • Mobile App: {"type":"connection", "version": "app"} πŸ“±

Login Message:

{"type":"login", "user":"userName", "password":"userPassword"} πŸͺͺ

When the client wants to display a message on the screen, it sends the following JSON, replacing "value" with the actual message:

Show Message Example:

{"type": "show", "value": "Hello World", "user": "userName"} πŸ’¬

Show Image Example:

{'type':'image', 'value': 'Base64image'} πŸ–Ό

Ask for active users:

{'type': 'usersList'} πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦β“



Server to Client πŸ“¨

Private

Message on connect:

{"type": "conexion"} 🌐

Login confirm/reject:

{"type":"login", "value":"true/false"} βœ…/❌

Response To Active Users:

{'type': 'usersOnline', 'value': [{'id':{'plataforma': 'app', 'usuario': 'Ronald'}]πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦

Broadcast

When Some User Connects:

{'type': 'connection', 'value': totalConnectionsNumber} βœ…

When Some User Disconnects:

{'type': 'disconnection', 'value': totalConnectionsNumber} ❌

When Some User Sends A Message:

{'type': 'sendMessage', 'value': userName} πŸ“¨



Note: The program is under development, and its features may change in future updates. πŸ”§