Skip to content
zainab Dnaya edited this page Oct 8, 2021 · 3 revisions

Welcome to the Webserver C++.

or if u are interested in how the HTTP server works!

Building your HTTP server is not that big of a deal, as you may already hear Websites that you use and enter use an HTTPS server which is not different it's just an HTTPS server but with more security! but now we gonna just focus on making HTTP servers just like Nginx.

History of HTTP :

The term hypertext was coined by Ted Nelson in 1965 in the Xanadu Project, which was in turn inspired by Vannevar Bush's 1930s vision of the microfilm-based information retrieval and management "memex" system described in his 1945 essay "As We, May Think". Tim Berners-Lee and his team at CERN are credited with inventing the original HTTP, along with HTML and the associated technology for a web server and a text-based web browser. Berners-Lee first proposed the "WorldWideWeb" project in 1989—now known as the World Wide Web. The first web server went live in 1990. The protocol used had only one method, namely GET, which would request a page from a server. The response from the server was always an HTML page

What is HTTP 🐰

https://h.top4top.io/p_2107p2e8n1.png

HTTP is a protocole for fetching resources such as HTML documents. It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. A complete document is reconstructed from the different sub-documents fetched, for instance, text, layout description, images, videos, scripts, and more.

easy?

https://d.top4top.io/p_2107u7p6s1.jpeg

So let's go.

first things we need to know what are the Components of HTTP-based systems:

  • Choose a Transport Layer is our case we will work with TCP where we can provide flow control and error handling, and participates in solving problems concerned with the transmission and reception of packets.

  • RFC: A Request for Comments (RFC) is an individually numbered publication in a series, from one of a small group of bodies, most prominently the Internet Engineering Task Force (IETF), the principal technical development and standards-setting bodies for the Internet.

  • Client Part 🥇: the user-agent => The user-agent is any tool that acts on behalf of the user. This role is primarily performed by the Web browser, but it may also be performed by programs used by engineers and Web developers to debug their applications.

  • The Web server Part 👍🏻:

    --> Proxies: Between the Web browser and the server, numerous computers and machines relay the HTTP messages, Due to the layered structure of the Web stack, most of these operate at the transport, network or physical levels, becoming transparent at the HTTP layer and potentially having a significant impact on performance.

Those operating at the application layers are generally called proxies it can handle.

------> caching (the cache can be public or private, as the browser cache)

------> filtering (like an antivirus scan or parental controls)

------> load balancing (to allow multiple servers to serve different requests)

------> authentication (to control access to different resources)

------> logging (allowing the storage of historical information)

Comunication between server components 💯 :

+++++++ What happens underneath when you tap an URL in your browser is that you sent a request to the server and it's something like this :

  GET / HTTP/1.1

  Host: developer.mozilla.org

  Accept-Language: en

+++++++ After The server accepts the connection with you (as a client), it Take the scented Request parse it and keep the wanted elements from it to send the right Respond and it's something like this:

  HTTP/1.1 200 OK

  Date: Sat, 09 Oct 2021 14:28:02 GMT

  Server: Apache

  Last-Modified: Tue, 01 Dec 2021 20:18:22 GMT

   ETag: "51142bc1-7449-479b075b2891b"

   Accept-Ranges: bytes

   Content-Length: 29769
  
   Content-Type: text/html

Are You Ready for what's Next? https://l.top4top.io/p_2107lb2i81.jpeg