Code Monkey home page Code Monkey logo

42-webserv's Introduction

Webserv - An HTTP Server in C++ 98

GitHub Status License

Description

Webserv is a powerful HTTP server written in C++ 98, inspired by popular web servers like Nginx. It is designed to provide efficient, non-blocking, and scalable web hosting capabilities. This server can serve fully static websites, handle HTTP methods (GET, POST, DELETE), support CGI for dynamic content, and much more. Webserv aims to be stress-tested and remains available under heavy loads.

Features

  • Configuration File Support: Webserv accepts a configuration file as an argument or uses a default path if none is provided. The configuration file allows you to define various server settings, route configurations, default error pages, and more.

  • Non-blocking I/O: Webserv employs the select() system call for all I/O operations, ensuring non-blocking communication between clients and the server, including listening.

  • Compatibility: Webserv is designed to be compatible with popular web browsers and adheres to HTTP standards to ensure seamless communication.

  • Accurate HTTP Response Status Codes: The server provides accurate HTTP response status codes to enhance the reliability and consistency of the web application.

  • Default Error Pages: In case no custom error pages are provided, Webserv includes default error pages to enhance user experience.

  • Static Website Hosting: Webserv can serve fully static websites, allowing you to host static content with ease.

  • File Upload Support: Clients can upload files to the server, facilitating various interactive web applications.

  • Stress-tested and High Availability: Webserv is designed to be stress-tested and remains available under heavy loads to ensure a reliable web hosting experience.

  • Multiple Listening Ports: Webserv can listen on multiple ports, and these ports can be configured in the configuration file.

  • Customizable Server Settings: You can choose the host and port for each server and set up server names as needed.

  • Route Configuration: Webserv allows you to configure routes with various settings, including accepted HTTP methods, HTTP redirection, directory listing, default files for directories, and more.

  • CGI Support: Webserv supports CGI for dynamic content generation. The server runs the CGI with the requested file as the first argument and handles the CGI output correctly.

  • Cookies and Session Management: Webserv provides support for cookies and session management to enable interactive and personalized web applications.

  • Multiple CGI Handling: The server can handle multiple CGI types, such as php-CGI, Python, etc., allowing you to integrate various scripting languages seamlessly.

Usage

$./webserv [configuration file]

or if you want to work with the default config

$./webserv

The server will start listening on the specified ports and will be ready to accept incoming HTTP requests.

42-webserv's People

Contributors

buflallo avatar fahiid33 avatar

Watchers

 avatar

Forkers

buflallo

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.