Giter Site home page Giter Site logo

zainabdnaya / webserv Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.42 MB

In this project is I write your HTTP server. HTTP is one of the most used protocols on the internet. Knowing its arcane will be useful, even if you won’t be working on a website.

License: MIT License

C++ 71.84% HTML 24.24% CSS 1.16% Makefile 0.78% PHP 1.85% Python 0.13% Scilab 0.01%

webserv's Introduction

WebServ

In this project is I write your HTTP server. HTTP is one of the most used protocols on the internet. Knowing its arcane will be useful, even if you won’t be working on a website. Check Wiki for details and understanding HTTP server

what you need to know !

read this Readme

Extra :
HTTP
Socket in cpp
Details about REST API Know your TCP system call sequences

Notes:

Initially HTTP client or Web Browser sends a HTTP request to the HTTP server.
Server Process The request received  and sends HTTP response to the HTPP client.
REST API :  is an architectural style for an  API that uses HTTP requests to access and use data.

Nginx Block Configurations

Nginx logically divides the configurations meant to serve different content into blocks, which live in a hierarchical   structure. Each time a client  request is made, Nginx begins a  process    of determining which configuration blocks should beused to handle the request. This decision process is what weå will be discussing in this guide.

The main blocks that we will be discussing are the server block and the location block:
    A server block is a subset of Nginx’s configuration that defines a virtual server used to handle requests of a defined type. Administrators often configure multiple server blocks and decide which block should handle which connection based on the requested domain name, port, and IP address.
    A location block lives within a server block and is used to define how Nginx should handle requests for different  resources and URIs for the parent server. The URI space can be subdivided in whatever way the administrator likes using these blocks. It is an extremely flexible model.

How Nginx Decides Which Server Block Will Handle a Request

Since Nginx allows the administrator to define multiple server blocks that function as separate virtual web server  instances, it needs a procedure for determining which of these server blocks will be used to satisfy a request.

It does this through a defined system of checks that are used to find the best possible match. The main server block    directives that Nginx is concerned with during this process are the listen directive, and the server_name directive.

Bind() VS Connect()

        bind() associates the socket with its local address [that's why server side binds, so that clients can use  that   address to connect to server.]
    
        connect() is used to connect to a remote [server] address, that's why is client side, connect [read as: connect to  server] is used.

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.