A simple web server made in C++
Find a file
2023-10-20 00:46:04 -04:00
.github/workflows Create docker-publish.yml 2023-09-06 16:56:23 -04:00
.screenshots update readme 2023-09-06 16:52:18 -04:00
benchmark v0.1.1 2023-10-17 13:16:31 -04:00
src remove error pages directory 2023-10-20 00:46:04 -04:00
.gitignore update build process 2023-10-20 00:45:20 -04:00
CHANGELOG.md v0.1.2 2023-10-17 13:33:22 -04:00
Dockerfile update build process 2023-10-20 00:45:20 -04:00
README.md README & CHANGELOG updates 2023-10-16 14:39:32 -04:00

Anthracite

A simple web server written in C++

Module-Based Backends

Anthracite includes (read: will include) system for allowing different "backend modules" to handle requests. This allows for anthracite to be extended for additional use-cases. For example, the following backends could be implemented:

  • File: Return files from a directory
  • Reverse Proxy: Pass the request to another server
  • Web Framework: Pass the request into an application built on your favorite web framework

Building & Debugging

Once you have the repository cloned, you can run the following command to build Anthracite:

make build

It will create a binary file named ./anthracite

To save time, you can use the following command to build and run anthracite on port 8080:

make run

To save time again, you can use the following command to build and debug anthracite in gdb:

make debug

Usage

Run the following commands to serve all files located in ./www/:

./anthracite [PORT_NUMBER]

Todo

  • Serve HTML Pages
  • Properly parse HTTP requests
  • Add module-based backend system for handling requests
  • Multithreading
  • Cleanup (this one will never truly be done)
  • Proper error handling
  • Build out module-based backend system for handling requests
  • Fix glaring security issues
  • Faster parsing
  • Speed optimizations such as keeping the most visited html pages in memory
  • Cleanup codebase
  • Enable cache support
  • Support newer HTTP versions

Screenshots

A picture of the default index.html page used by Anthracite A picture of the Anthracite default 404 not found page


"By industry, we thrive"