There are required fields at the beginning of each package.
- 1 byte contains the packet type
- 2-5 bytes contain the length of the packet
This is the first packet sent to the server to add a new user/contact.
| 0 | 0 | 0 | 1 | 0 | 0 | 0 | X |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
-
the eighth bit of the first byte contains an indication. if equal to 1, then this is a packet from the contact, if equal to 0, then the packet is from the user
-
6-7 bytes contain id of user/contact
This packet is sent by the server in response to a connect packet.
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- the eighth bit of the first byte indicates if the server has added a new user/contact. 1 - didn't add, maybe this id is already used, 0 - everything is ok
- 6-n bytes are used only for users. They store the ids of all contacts that are currently active.
This packet is sent by the user to notify the server that he wants to connect to a specific contact.
| 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- 6-7 bytes store the contact id that the user wants to connect to
This is the server's response to the INTERCEPT packet
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- the eighth bit of the first byte indicates whether the requested contact exists with that id. 1 - does not exist, 0 - everything is ok
- 6-n bytes store the ip address of the requested contact
This package stores a portion of the compressed contact screen image
| 0 | 1 | 0 | 1 | 0 | 0 | 0 | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- the eighth bit of the first byte indicates the packet number. 2 - the last part of the screenshot, 1 - in other cases
- 6-n bytes is part of the screenshot
This package notifies the user of new or disconnected contacts
| 0 | 1 | 1 | 0 | 0 | 0 | 0 | X |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- the eighth bit of the first byte indicates whether to add a new contact or remove it. 1 - delete, 0 - do not delete
- 6-7 bytes - contact id
this packet is sent to the server to notify it that a user/contact has been disconnected
| 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
This packet is sent by the user directly to the contact in order to perform some action on his side
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
| X | X | X | X | X | X | X | X |
- the fourth - eighth bit of the first byte indicates what the command is. 0 - move the mouse, 1 - press a key on the keyboard, 3 - press a key on the mouse, 4 - release a key on the mouse
- 6-n bytes carry extra. information. Mouse coordinates, key number on the keyboard, left or right button on the mouse