{"id":18337781,"url":"https://github.com/pin3dev/42_webserv","last_synced_at":"2025-07-13T22:08:28.082Z","repository":{"id":252129306,"uuid":"794134996","full_name":"pin3dev/42_Webserv","owner":"pin3dev","description":"A simple HTTP/1.1 server written in C++, supporting GET, POST, DELETE methods, virtual hosting, CGI script execution, and custom error pages. Ideal for understanding the basic concepts of web servers.","archived":false,"fork":false,"pushed_at":"2024-08-14T11:53:17.000Z","size":52932,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:18:51.514Z","etag":null,"topics":["42-webserv","42born2code","42projects","42school","cgi-application","cgi-script","html-css-javascript","multiplexing-circuits","polling","socket-io","webserver","website"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pin3dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-30T14:17:46.000Z","updated_at":"2025-03-10T19:54:59.000Z","dependencies_parsed_at":"2024-08-14T13:09:31.725Z","dependency_job_id":null,"html_url":"https://github.com/pin3dev/42_Webserv","commit_stats":null,"previous_names":["pin3dev/42_webserv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pin3dev/42_Webserv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_Webserv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_Webserv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_Webserv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_Webserv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pin3dev","download_url":"https://codeload.github.com/pin3dev/42_Webserv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_Webserv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265212934,"owners_count":23728629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42-webserv","42born2code","42projects","42school","cgi-application","cgi-script","html-css-javascript","multiplexing-circuits","polling","socket-io","webserver","website"],"created_at":"2024-11-05T20:12:15.634Z","updated_at":"2025-07-13T22:08:28.058Z","avatar_url":"https://github.com/pin3dev.png","language":"C++","readme":"# Webserv `110/125`\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/pin3dev/42_Cursus/blob/192db266f898636eefa274ed3be4aa8cc11b1397/assets/Webserv/Rdm/webserv_demo.gif\" width=\"600\" height=\"375\" /\u003e\n\u003c/p\u003e\n\n## Table of Contents  \n- [Project Overview](#overview)  \n- [Mandatory Features](#features)  \n- [Project Compilation and Execution](#compilation-and-execution)  \n- [Tests -  Usage Examples](#usage-examples)  \n- [Contributors and License](#contributors)  \n\n\n## Overview  \n\nThe `Webserv` project is designed to handle HTTP requests and responses, implementing basic functionalities of a web server \nsuch as parsing HTTP requests, managing server configurations, handling connections, and serving static files or CGI scripts.  \n\n## Features  \n1. HTTP/1.1 compliant\n2. Support for GET, POST, and DELETE methods\n3. Custom configuration file support\n4. Virtual hosting\n5. Autoindexing  \n6. Error handling and custom error pages  \n7. CGI script execution\n \n## Compilation and Execution\nTo compile the project, clone the repository and use the provided Makefile.  \n\n```bash\ngit clone https://github.com/pin3dev/42_Webserv.git   \ncd 42_Webserv  \nmake\n```\n\n## Usage Examples\nIf no configuration file is specified, the server will use the default configuration located at configs/default.conf.\n```bash\n./webserv [configuration file]\n```\n\n### Configuration\nThe configuration file allows you to set up the server and define its behavior. Below is an example of a basic configuration:\n\n```bash\n\nserver {\n\tserver_name www.site1;\n\tlisten 8080;\n\thost localhost;\n\troot www/site1;\n\tindex index.html;\n\tclient_max_body_size 2M;\n\terror_page 404.html;\n\n\tlocation / {\n\t\tallow_methods GET;\n\t\t#try_file tutorial.html;\n\t}\n\n\tlocation /upload {\n\t\tallow_methods GET DELETE;\n\t}\n\n\tlocation .py {\n\t\tallow_methods GET POST;\n\t\tcgi_path /cgi;\n\t\tcgi_ext .py;\n\t\tupload_to /upload;\n\t}\n\n\tlocation /favicon.ico {\n\t\tallow_methods GET;\n\t}\n\n\tlocation /assets {\n\t\tallow_methods GET;\n\t\tautoindex on;\n\t}\n\n\tlocation /redirect {\n\t\tallow_methods GET;\n\t\treturn /;\n\t}\n}\n```\n#### Configuration Directives\n- listen: The port on which the server will listen.\n- server_name: The server's domain name.\n- root: The root directory for the server.\n- index: The default index file.\n- error_page: Custom error pages.\n- location: Define specific behavior for certain URL patterns.\n- autoindex: Enable directory listing.\n- cgi_path: Path to the CGI executable.\n- cgi_ext: File extension for CGI scripts.\n- allow_methods: HTTP methods allowed for the location.\n- upload_to: Directory for file uploads.\n  \n### Code Structure\n`Makefile`: Instructions for compiling the project.  \n`exe/`: Source files for the main server functionality.  \n`inc/`: Header files.  \n`configs/`: Example configuration files.  \n\n### Testing\nThere is a tutorial page in HTML `www/site1/tutorial.html` that helps with testing the server using `curl` and directly in the browser. \nThis page provides examples and instructions on how to perform various HTTP requests and view the results.  \n\nTo access the tutorial page:\n\n1. Ensure the server is running.\n2. Open a web browser and navigate to `http://localhost/tutorial.html`\n3. This page will guide you through testing different endpoints and methods supported by the server.\n\n## Contributors\n\n* Ívany Pinheiro aka [`@pin3dev`](https://github.com/pin3dev)  \n* Clara Franco aka [`@clima-fr`](https://github.com/clima-fr)  \nFeel free to submit issues or pull requests if you have suggestions or improvements.\n\n## License\nThis project is open-source and available under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3dev%2F42_webserv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpin3dev%2F42_webserv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3dev%2F42_webserv/lists"}