Giter Club home page Giter Club logo

42_webserv's Introduction

cpplint make

webserv

This is when you finally understand why a URL starts with HTTP

Sockets

  • A socket is one end of an interprocess communication channel.

  • Processes can communicate with each other only if their sockets are of the same type and in the same domain

  • There are two widely used address domains

    • unix domain, in which two processes which share a common file system communicate
    • Internet domain in which two processes running on any two hosts on the Internet communicate
  • Each socket needs a port number on that host. Port numbers are 16 bit unsigned integers. The lower numbers are reserved in Unix for standard services

  • There are two widely used socket types, stream sockets, and datagram sockets

    • Stream sockets use TCP (Transmission Control Protocol), which is a reliable, stream oriented protocol
    • Datagram sockets use UDP (Unix Datagram Protocol), which is unreliable and message oriented.

The steps involved in establishing a socket on the client side are as follows:

  • Create a socket with the socket() system call
  • Connect the socket to the address of the server using the connect() system call
  • Send and receive data

CONFIG FILE

How works

Syntax:     server { ... }
Default:     —
Context:     http

Sets configuration for a virtual server.

Syntax:     listen address[:port] ...
Default:     listen *:80 | *:8000;
Context:     server

Sets the address and port for IP.

Syntax:     server_name name ...;
Default:     server_name _;
Context:     server

Sets names of a virtual server.

Syntax:     error_page code ... uri;
Default:     —
Context:     server

Defines the URI that will be shown for the specified errors.

Syntax:     client_max_body_size size;
Default:     client_max_body_size 1m;
Context:     server

Sets the maximum allowed size of the client request body.

Syntax:     root path;
Default:     root html;
Context:     server

Sets the root directory for requests.

Syntax:     location uri { ... }
Default:     /
Context:     server

Sets configuration depending on a request URI.

Syntax:     index file ...;
Default:     index index.html;
Context:     server

Defines files that will be used as an index.

Syntax:     auto on | off;
Default:     autoindex off;
Context:     location

Enables or disables the directory listing output.

42_webserv's People

Contributors

guimartinelli avatar luigienzoferrari 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.