https://github.com/h-sarhan/webserv
An HTTP web server written in C++
https://github.com/h-sarhan/webserv
42school cpp98 http-server
Last synced: about 1 year ago
JSON representation
An HTTP web server written in C++
- Host: GitHub
- URL: https://github.com/h-sarhan/webserv
- Owner: h-sarhan
- License: mit
- Created: 2023-05-02T22:21:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-06T13:45:09.000Z (almost 3 years ago)
- Last Synced: 2025-04-10T00:50:57.149Z (about 1 year ago)
- Topics: 42school, cpp98, http-server
- Language: C++
- Homepage:
- Size: 24.9 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Table of Contents
## About The Project
![Web Server][product-screenshot]
This project is an implementation of an HTTP web server written in C++. The server can handle incoming multiple concurrent requests from web clients and serve them with HTML files or other static resources, such as images or CSS files. The server also supports the HTTP/1.1 protocol, including features such as persistent connections, chunked encoding, and content compression. In addition, the server includes support for dynamic content generation through CGI scripts, allowing developers to write server-side scripts in languages such as Perl or Python.
This HTTP web server is a highly reliable implementation that remains stable even under extreme loads and with limited system resources. Its efficient design ensures that the server can handle a large number of incoming requests without crashing or hanging
## Features
* Able to handle multiple concurrent requests
* Implements the HTTP protocol including GET, POST, and DELETE requests
* HTTP/1.1 support with persistent connections and chunked encoding
* Static file serving for HTML files, images, and other resources
* CGI script support for dynamic content generation
* Robust and resilient implementation
* Parses a configuration file
* Handles multiple CGIs
* Supports cookies and session management
## Getting Started
### Prerequisites
The only prerequisites for this project are a C++ compiler and the Make build system
This project produces no warnings even with strict warning flags on gcc and clang
* To compile
```sh
make
```
* To run our tests
```sh
make test
```
### Usage
* To run the web server with default configuration
```sh
./webserv
```
* To run the web server with a custom configuration
```sh
./webserv ./server.conf
```
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
[stars-shield]: https://img.shields.io/github/stars/h-sarhan/webserv.svg?style=for-the-badge
[stars-url]: https://github.com/h-sarhan/webserv/stargazers
[issues-shield]: https://img.shields.io/github/issues/h-sarhan/webserv.svg?style=for-the-badge
[issues-url]: https://github.com/h-sarhan/webserv/issues
[license-shield]: https://img.shields.io/github/license/h-sarhan/webserv.svg?style=for-the-badge
[license-url]: https://github.com/h-sarhan/webserv/blob/master/LICENSE
[product-screenshot]: https://www.hostinger.com/tutorials/wp-content/uploads/sites/2/2018/06/How-Server-Work.webp