github.com/Tenire/TinyWebServer

Notes

Open this visualization on its own page →

Contributors

9

Lines of Code

808

From

2020-02-21

To

2022-04-02

About Tenire/TinyWebServer

TinyWebServer is a lightweight web server written in C++ designed to help beginners learn network programming and build their own server applications on Linux. The project implements a concurrent architecture using a thread pool combined with epoll (supporting both edge-triggered and level-triggered modes) and a Proactor pattern simulation. It parses HTTP requests using a state machine, supporting both GET and POST methods, and integrates with MySQL databases to provide user registration and login functionality, as well as the ability to serve image and video files.

The server includes both synchronous and asynchronous logging systems to track runtime status and has been stress-tested with Webbench to handle tens of thousands of concurrent connections. The project is highly customizable, allowing developers to modify various aspects including the choice between level-triggered and edge-triggered I/O multiplexing modes for different socket types, and switching between synchronous and asynchronous log writing methods. Configuration requires setting up MySQL, modifying database initialization parameters, adjusting the root file path, and then compiling and launching the server, which can then be accessed through standard web browsers.

Share this video