A lightweight HTTP server written in C using sockets, capable of handling basic requests and serving static files.
- Handles HTTP GET requests
- Serves static files (HTML, CSS, JS, images, etc.) from the
public/directory - Returns 404 for missing files
- Simple request parsing and response headers
- Easily extensible for more HTTP methods
Note
This project is a learning exercise in C programming and socket programming. It is not intended for production use.
Http-Cerver
├── includes/
│ └── http/
├── vendor/
├── certs/
├── public/
│ └── img/
│ └── www/
│ └── css/
│ └── html/
├── src/
│ ├── http/
│ │ ├── parser.c
│ │ ├── responce_headers.c
│ │ └── responce.c
│ ├── main.c
│ ├── proxy.c
│ ├── logging.c
│ └── server.c
├── scripts/
│ ├── build.sh // Build the project
│ └── format.sh // Format the code using clang-format
├── build/
├── bin/
├── CMakeLists.txt
├── LICENSE
├── .clang-format
├── .gitignore
└── README.md
- GCC or Clang
- CMake (for building)
./scripts/build.shThe server binary will be in build/http_server.
./build/http_serverBy default, the server serves files from the public/ directory.
Open http://localhost:4500/ in your browser to see the default welcome page.
- Support HTTPS
- Add dynamic config
- Support HTTP/2
- Implement UDP from scratch
- Implement HTTP/3 from scratch
This project is licensed under the GNU GPL v3.
Feel free to open issues or submit pull requests for improvements and new features!
