Giter Site home page Giter Site logo

merituulie / webserv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rosamakinen/webserv

0.0 0.0 0.0 7.63 MB

An HTTP server based on the Hypertext Transfer Protocol specifications, focusing on serving a static website, handling dynamic content through CGI (Common Gateway Interface), and supporting various HTTP methods like GET, POST, and DELETE.

C++ 85.31% Python 2.71% Makefile 1.82% HTML 10.16%

webserv's Introduction

weberver ๐ŸŒ

This project implements an HTTP server based on the Hypertext Transfer Protocol (HTTP) specifications, focusing on serving static websites and handling dynamic content through CGI (Common Gateway Interface), and supporting various HTTP methods like GET, POST, and DELETE.

Introduction ๐Ÿš€

The Hypertext Transfer Protocol (HTTP) is fundamental for distributed, collaborative, hypermedia information systems, forming the backbone of communication for the World Wide Web. HTTP facilitates the transfer of hypertext documents, allowing users to access resources through hyperlinks via web browsers.

Features ๐Ÿ“‹

  • Configuration File Handling: The program accepts a configuration file .config as an argument or uses a default configuration file.
  • Compatibility: The server is compatible with Google Chrome and adheres to HTTP version 1.1 standards.
  • Error Handling: Proper HTTP response status codes and default error pages are provided.
  • HTTP Methods: Supports GET, POST, and DELETE methods.
  • File Upload: Clients are able to upload files.
  • Configuration Flexibility: The configuration file allows for setting up servers, defining routes, limiting client body size, directory listing, setting up where to upload files, etc.
  • CGI Execution: Server allows executing python based CGI scripts.
  • Resilience: The server remains available under stress and does not hang forever on requests.

Configuration File โš™๏ธ

The configuration file resembles NGINX's configuration format, allowing users to specify server settings, routes, error pages, etc. Some key features of the configuration file include:

  • Choosing port and host for each server.
  • Defining server names and default servers.
  • Setting up custom error pages (default error pages provided).
  • Limiting client body size.
  • Configuring routes with accepted HTTP methods, redirections, file directories, CGI execution, etc.

Conclusion ๐ŸŽ‰

This HTTP server implementation aims to provide a resilient, feature-rich solution for serving web content while adhering to HTTP standards and ensuring compatibility across different platforms and browsers.

Setting Up the Project with Makefile

1. Clone the Repository ๐Ÿ“

  • git clone <repository_url>

2. Set Up the Project ๐Ÿš€

  • Make sure you have a C++ compiler installed (preferably `g++`).
  • Navigate to the project directory.

3. Makefile Usage ๐Ÿ› ๏ธ

  • `make all`: Compiles the project.
  • `make clean`: Removes all object files.
  • `make fclean`: Removes all object files and the executable.
  • `make re`: Performs a clean build (removes all object files and recompiles).

4. Compilation ๐Ÿ–ฅ๏ธ

  • Run `make all` to compile the project.
  • The compiled executable will be named `webserv`.

5. Customization ๐Ÿ› ๏ธ

  • Adjust `CFLAGS` in the Makefile for any specific compilation flags you require.
  • Modify source files (`.cpp`) and header files (`.hpp`) in the `src/` and `include/` directories respectively to customize the project.

6. Compilation Output ๐Ÿ’ป

  • The compiled executable `webserv` will be created in the project directory upon successful compilation.

webserv's People

Contributors

merituulie avatar forbidden-arts avatar rosamakinen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.