NMC Pro

Post Detail

How is the web working?

How is the web working?

Every time you open your browsers, type some URLs and press enter, you will see beautiful web pages appear on your screen. But do you know what is happening behind these simple actions?

Normally, your browser is a client. After you type a URL, it takes the host part of the URL and sends it to a Domain Name Server (DNS) in order to get the IP address of the host. Then it connects to the IP address and asks to setup a TCP connection. The browser sends HTTP requests through the connection. The server handles them and replies with HTTP responses containing the content that make up the web page. Finally, the browser renders the body of the web page and disconnects from the server

A web server, also known as an HTTP server, uses the HTTP protocol to communicate with clients. All web browsers can be considered clients. We can divide the web's working principles into the following steps:

  • Client uses TCP/IP protocol to connect to server.

  • Client sends HTTP request packages to server.

  • Server returns HTTP response packages to client. If the requested resources include dynamic scripts, server calls script engine first.

  • Client disconnects from server, starts rendering HTML.

This is a simple work flow of HTTP affairs -notice that the server closes its connections after it sends data to the clients, then waits for the next request.

0 Comments

No comments yet. Be the first to share your thoughts!

Leave a Comment

0 / 1500 characters

AI Assistant

Online

Press Enter to send · Shift+Enter for new line