Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

181 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webserv

Welcome to the repository for our Webserv project, a part of the curriculum at 42. This project focuses on creating a basic web server from scratch in C++. It's designed to help you understand the inner workings of how web servers handle incoming HTTP requests, parse them, and serve the appropriate content.

Table of Contents

Introduction

The Webserv project challenged us to build a web server capable of handling multiple incoming connections, parsing HTTP requests, and responding with the appropriate HTTP responses. We implemented support for various HTTP methods, handle static and dynamic content, and handle different HTTP status codes. This project was a fantastic opportunity to deepen our understanding of networking, the HTTP protocol, and C++ programming.

Features

  • HTTP/1.1 Compatible: The server is compliant with the HTTP/1.1 protocol, capable of parsing incoming requests and generating appropriate responses.
  • Dynamic Content: Support for server-side scripting, enabling dynamic content generation using Common Gateway Interface (CGI).
  • Static Content: Efficiently serve static files (HTML, CSS, JS etc.) to clients.
  • Configurable: The server's behavior is determined by a configuration file, allowing you to specify settings such as the listening port, server name, and more.

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • A C++ compiler (e.g., c++)
  • Unix-based operating system (right now only macOS supported)

Installation

  1. Clone this repository:

    git clone https://github.com/Mowriez/webserv.git
  2. Navigate to the project root directory:

    cd webserv
  3. Compile the project:

    make

Usage

  1. Start the server:

    ./webserv [path_to_config_file]

  2. Send HTTP requests to the server using your favorite web browser or a tool such as curl or Postman:

    curl -X GET http://localhost:8080/

  3. Stop the server by pressing Ctrl + C in the terminal window.

Contributors

In alphabetical order:

Maurice Trautner
Thule Reeps
Tony Williams

License

This project uses the MIT License.


This project was completed as part of the curriculum at 42 Wolfsburg

About

A lightweight webserver with simple functionalities (only macOS)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages