Skip to content
/ chat Public

Asynchronous client-server chatting application using boost::asio and c++17. Creation goal - learning.

License

Notifications You must be signed in to change notification settings

Roout/chat

Repository files navigation

Client-server application: simple chat

About

Async client server chat written on C++ (std::c++17) using boost::asio library.

Goal

  1. to formalize the data exchange, the server may implement an API
    • define specific content format
    • parse it.
  2. scheduling system to prioritize incoming requests from clients to accommodate them
  3. to prevent abuse and maximize availability, the server software may limit the availability to clients (agains DoS attacks)
  4. encryption should be applied if sensitive information is to be communicated between the client and the server.

TCP protocol will be used.

Requirements

  • CMake 3.16 or higher
  • C++17 standard or higher
  • boost 1.72.0 or higher for asio
  • OpenSSL 1.1.1l
  • google test will be downloaded by cmake as external project (see vendor/gtest)
  • rapidjson will be downloaded by cmake as external project (see vendor/rapidjson)

Quick start

...

Notes

  • There is a bash script used to generate all needed information for the server. You shoud run it before building project
cd settings
# provide domain name (server for this case)
# also note, script must be executable
gen-crt.sh server

TODO

  • read data from client
  • pass read data to server
  • broadcast received data to all clients
  • timely remove all connections that were closed
  • Add safe client disconnection
  • Add safe server disconnection
  • Fix errors and add multithreading safety:
  • can I remove server pointer from the session? - Can't
  • reorganize work with buffers.
  • make copy of the project and apply cooroutings!

Expected result

  • simple protocol & parser for text messages
    • define message structure
    • define parser
  • one chatroom with several users
    • it will broadcast if somebody joined
    • it will broadcast if somebody leave
    • timeouts with timers for the server to avoid server's abuse
    • force to choose username
    • add login/logout
    • add SSL
  • support multithreading for server
  • implement some simple GUI for the clients

About

Asynchronous client-server chatting application using boost::asio and c++17. Creation goal - learning.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published