ChaosStack Relay Chat

This is the challenge where you can meet your competitors virtually. You have to develop a chat application. The networking architecture is quite simple, in the client-server model the server will relay all the messages of the clients. The protocol is however non-standard.

The UI should contain three parts. First one is the list of users logged in. The second one is a text entry for the user to send the message. The third one is the box for the messages in the order they arrive.

The server and your client use the same protocol. The unencrypted TCP data stream consists of messages. Each message starts with a one byte command, followed by UTF-8 encoded payload and delimited by the DEL character 0x7f. The maximum length of the messages is 256 bytes, including the command and the terminator character. Enhance your calm – your connection is rate limited; if you exceed 5 messages in 10 seconds, the server will terminate your connection.

Types of messages are:

  • HELLO (1). This is the greeting from the server (with its version number) and you must also greet the server when connecting.
  • USERNAME (2) and PASSWORD (3). The client must state its username and password when connecting.
  • SERVER MESSAGE (4) which contains instructions. May be presented to the user.
  • MESSAGE (5) which contains text typed by other users. When the client sends this, payload is the message itself. When originating from the server, payload is the name of the user (32 characters maximum), a colon character 0x3a, and the text.
  • PING (6) and PONG (7). If your client is inactive, the server will regularly ping you. You may also ping the server if you suspect that your connection is lost. Pong response is mandatory.
  • QUIT (8). Send this before terminating the connection.
  • LOGIN (9) and LOGOUT (10). Other users logging in and out; payload is their name.

There is also a robot client on the server. It tells a joke if you type ?joke, and logs in and out if you type ?reconnect. It helps you with debugging your application. You might also meet other competitors in the chat room.

You can use any programming language, graphical library and socket library you like. You have to develop the client, the server is available. Contact the mentor for details (server info and account).

ui networking


  • (×2) Basic functionality.
  • List of logged in users.
  • Taking care of PING messages.
  • (×2) Rate limiting the user.
  • Taking care of other limits.
  • Error handling.
  • Configurabilty of the client.
  • UI design, UX.


When you are ready, you should show your client application to Zoltan Czirkos, one of our community mentors.

Submission is not eligible for any points if the basic functions do not work: logging in and out, sending and receiving messages, displaying the conversation.