WebServer is an HTTP/1.1 server implemented from scratch in C++98, designed to handle HTTP requests, responses, and dynamic content generation through CGI scripts.
- HTTP Protocol Support: Handles standard HTTP methods and responses.
- Static File Serving: Efficiently delivers static content to clients.
- CGI Support: Executes Common Gateway Interface scripts for dynamic content generation.
- Error Handling: Provides custom error pages for various HTTP status codes.
- Configurable Design: Easily customizable via configuration files.
- Unit Testing: Includes unit tests to ensure code reliability.
- HURL Integration: Uses HURL for advanced HTTP testing and validation.
- Clone the Repository:
git clone https://github.com/BenjaminHThomas/WebServer.git
- Build the Server:
cd webserver make
- Run the Server:
./webserver <config_filename>.json
- Clone the Repository:
git clone https://github.com/BenjaminHThomas/WebServer.git
- Build and Run the Server:
cd webserver docker-compose up --build
The server requires a configuration file to run. Examples are provided in the config
directory, such as config.json
. These files define server parameters, routes, and CGI script paths.
- Unit Tests: Run
make test
to execute the suite of unit tests, ensuring functionality and stability. - HURL Testing: Utilize HURL scripts to perform comprehensive HTTP tests. These validate server behavior under various scenarios.
After starting the server with a configuration file, access it via the specified host and port in the configuration file. For example, if the configuration sets the server to listen on 127.0.0.1:8080
, access it through http://127.0.0.1:8080
or http://localhost:8080
.
This project is licensed under the MIT License.