A lightweight HTTP server built from scratch in C, designed for educational purposes and to demonstrate fundamental networking concepts.
- Handles basic HTTP GET, POST, PUT, DELETE, HEAD requests
- Serves static files from a specified directory
- Implements minimal HTTP request parsing
- Provides appropriate HTTP response headers
- GCC compiler
- Make utility
- POSIX-compliant operating system (e.g., Linux, macOS)
-
Clone the repository:
git clone https://github.com/LeeBingler/HTTP-server-C.git cd HTTP-server-C
-
Build the project
make
-
Run test
make test
Usage: http-server-c [OPTIONS]
Open a web server on PORT with ROOT_DIR as root.
Options:\n"
-p, --port [PORT] Specify the port number (default: 8080)
-r, --root [ROOT_DIR] Set the root directory (default: ./www)
--help Show this help message
Examples:
./my-server -p 8080 -r ./www/
└── HTTP-server-C/
├── LICENSE
├── Makefile
├── README.md
├── include
│ ├── config.h
│ ├── core
│ ├── http
│ ├── request
│ └── utils
├── src
│ ├── core
│ ├── http
│ ├── request
│ └── utils
├── tests
│ ├── integration
│ └── run_tests.sh
└── www
This project is licensed under the MIT License. See the LICENSE file for details.