Skip to content

This project is here to make you write your own HTTP server. You will be able to test it with a real browser. HTTP is one of the most used protocol on internet. Knowing its arcane will be useful, even if you won't be working on a website.

Notifications You must be signed in to change notification settings

Mou-SED/WebServ_42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebServ_42

In this project, we will build our own web server. First, let's define what a web server is. A web server is a computer program that delivers web pages to users. When you visit a website, your web browser sends a request to the web server. The web server then sends the requested web page back to your web browser.

Many people use the internet to watch movies or send messages. The videos and images that you watch or send are stored in the cloud. The cloud is a network of servers that store data. When you watch a movie or send a message, the web server retrieves the video or image from the cloud and sends it to your web browser.

In this project, we will build a web server that can store and deliver web pages. We will use the Python programming language to create our web server.

HTTP

Socket-Bind-listing-connection

S_B_L_C

Socket:

Sockets allow communication between two different processes on the same or different machines. Socket

Bind

bind is a system call that associates a socket with a local address and port number. This allows the socket to receive connections from other computers on the network.

Bind

listen

is used to listen for incoming connections on a socket. The listen() function takes two arguments: the first argument is the socket file descriptor, and the second argument is the backlog queue size. The backlog queue size is the maximum number of connections that can be queued before the system starts refusing connections.

accept

is used to accept an incoming connection on a socket. The accept() function takes two arguments: the first argument is the socket file descriptor, and the second argument is a pointer to a sockaddr structure, which will be filled in with the address of the client that connected.


HTTP

HTTP stands for HyperText Transfer Protocol. It is a set of rules for exchanging data between a client and a server. HTTP is the foundation of the World Wide Web, and it is used to transfer all kinds of data, including HTML pages, images, videos, and files. Here explain all of the previews : HTTP

Request:

Request

RequestLine :

requestLine


CGI :

  • CGI : (Common Gateway Interface) is used to provide a dynamic content to the user. It is a standard way for web servers to interact with external programs. CGI programs are typically written in scripting languages such as Perl, Python, or PHP.

When a user requests a page that contains a CGI script, the web server will execute the script and return the results to the user. This allows web servers to generate dynamic content, such as personalized web pages or interactive forms.

cgi

Here explain more about CGI how it's Work

Cgi


Resouces

About

This project is here to make you write your own HTTP server. You will be able to test it with a real browser. HTTP is one of the most used protocol on internet. Knowing its arcane will be useful, even if you won't be working on a website.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published