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: 9 months ago
JSON representation
This project is about writing your own HTTP server
- Host: GitHub
- URL: https://github.com/maricard18/42-webserv
- Owner: maricard18
- Created: 2023-10-10T09:04:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-03T20:17:07.000Z (over 2 years ago)
- Last Synced: 2025-07-26T08:27:19.307Z (11 months ago)
- Topics: 42, 42-webserv, 42-webserver, 42born2code, 42cursus, 42projects, 42school, 42webserv, cpp, http, http-server, webserv, webserver
- Language: C++
- Homepage:
- Size: 120 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)