Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maricard18/42-webserv

This project is about writing your own HTTP server
https://github.com/maricard18/42-webserv

42 42-webserv 42-webserver 42born2code 42cursus 42projects 42school 42webserv cpp http http-server webserv webserver

Last synced: 15 days ago
JSON representation

This project is about writing your own HTTP server

Awesome Lists containing this project

README

        

# **webserver**
This project was graded 110/100

-> [Subject](./assets/subject.pdf)

## ๐Ÿ“ **Authorship**

- [Mario Henriques](https://github.com/maricard18) ([**maricard**](https://profile.intra.42.fr/users/maricard))
- [Bruno Costa](https://github.com/BrunoCostaGH) ([**bsilva-c**](https://profile.intra.42.fr/users/bsilva-c))

## ๐Ÿงฌ **Cloning**

To successfully clone this repository, use this command

```shell
git clone https://github.com/maricard18/42-webserver.git
```

## ๐Ÿ“’ **About**
This project guides you in building a C++ HTTP server, offering a practical understanding of the HTTP protocol.

Test your server with real browsers and delve into the fundamentals of networking.

Gain insights into web security while creating a functional web server, even if web development isn't your primary focus.

Webserv provides a hands-on, educational experience for anyone interested in the core technologies of the internet.

## ๐ŸŽฅ **Demo**



## ๐Ÿ“ฆ **Compilation**
To compile the webserver you should run `make` with the configuration file of your choice.


This rule will generate a `webserv` file, which is the zipped version of all the object files.


To launch the executable you should follow this syntax...

```sh
$ ./webserv config_file/server.conf
```

Where `config_file/server.conf` is the name of a file that represents the configuration of the webserver.


You can find example of configuration files in the `config_files` folder.

## ๐Ÿ•น๏ธ **Configuration File rules**

```bash
Server {
root /absolute/path;
index index.html; # optional
autoindex true; # optional, default is false
server_name _; # optional
listen 0.0.0.0:8080; # optional IP, default is 0.0.0.0:8080
client_max_body_size 1M; # optional, default is 1M
upload_store /path/to/uploaded/files; # optional, default is /uploads
error_page 404 /relative/path/to/error/page.html; # optional

location /delete/ {
# root /path/to/root;
# index index_file.html;
# autoindex false/true;
# allow_methods GET POST DELETE;
}

location .py {
# path to executable
cgi_pass /absolute/path/to/executable;
}
}
```

## ๐Ÿ’ซ **Testing**

This project was tested using self-made tests

You can find some of them in the `tests` folder.

---
> Feel free to ask me any questions through Slack (**maricard**).

> GitHub [@maricard18](https://github.com/maricard18) ย ยทย 
> Linkedin [Mario Henriques](https://www.linkedin.com/in/mario18) ย ยทย 
> [42 Porto](https://www.42porto.com/en)