In this project, I wrote an MQTT server (version 3.1.1). I found this protocol interesting. I tried to write a server based on the documentation as much as possible, but I could make mistakes or miss some details. The project was tested with mosquitto
- QoS (all levels)
- Reconnect to session (clean session)
- Sending WillMessage on client connection to WilTopic subscribers
- All main commands
- SSL/TSL connections
- Authentication
- For this project, I specifically wrote a prefix tree class
- I changed the PINGREQ timeout (increased by 2 times, instead of 1.5)
- When reconnecting to the session, all packets that remain are sent to the user.
- The project is written using Boost.Asio and C++20, so make sure your computer has it.
cmake ..
cmake --build .
./mqtt_server -f filename -p port
Note: it is not necessary to initialize both parameters, the default parameters are set inside the program (filename - file.log, port - 1883)
- Testing program: https://mosquitto.org/
- Documentation: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1/1-os.html
