CppServer is a fast C++ Server with multithreading and custom memory management via a custom-made memory pool. A Few of the features include:
- Multithreading with a thread pool: This server supports multithreading, using a thread pool to avoid too mush CPU usage, and to not allocate more threads than necessary
- HTTP support: The server supports HTTP, and is capable of sending HTML, JSON, CSS, AVIF, WEBP, PNG, and SVG to clients
- If you run the server, it shows my website's main page. It also contains files of other types to mess around with
- CppServer currently only supports Linux, and has only been tested on Ubuntu 24.04.2 LTS.
- You need top Ctrl-C TWICE to exit, not once.
To setup CppServer, There are a couple things to do:
- Enter src/main.cpp with your favorite text editor (vim, vi, vscode, etc.)
- Change 'new Server(8080, "192.168.1.30")' to 'new Server(8080, "<your ip address>")', replacing <your ip address> with your machine's actual IP
- Type make to compile the code, then make run to run it
(Optional) Stress test CppServer
- In test.cpp, change the Server ip & port to the correct values
- Compile the test with 'g++ test.cpp -o test'
- Run the test './test'
make # Compile the code
make run # Run CppServer
# In a separate terminal window...
# Stress test CppServer with C++
g++ test.cpp -o test
./testTo use CppServer, you can add files to the site/ directory, and access them from the web. For example you can load site/index.html by going to '<your ip address>:8080/index.html'. There is already a basic index.html to test