How does the Web work, browse the Web, open a browser, enter a URL, press ENTER, and then display the content, what is the process?

Source: Internet
Author: User

The following excerpt from Go Web programming is easy to understand.

When we browse the Web, we open the browser, enter the URL and press ENTER, then we will show you what you want to see. What is hidden behind this seemingly simple user behavior?
For the normal online process, the system is actually doing this: the browser itself is a client, when you enter the URL, the first browser will go to request a DNS server, through DNS to obtain the corresponding domain name corresponding IP, and then through the IP address to locate the IP corresponding server, the request to establish a TCP connection, After the browser sends the HTTP request (request) packet, the server receives the request packet before it starts processing the request package, and the server calls its own service, returning an HTTP Response (response) packet The client receives a response from the server and starts rendering the body (body) in the response package, and then disconnects the TCP connection to the server after receiving the entire content.

A Web server is also known as an HTTP server, which communicates with clients through the HTTP protocol. This client usually refers to a Web browser (in fact, the mobile client is also implemented inside the browser).
How the Web server works can simply be summed up as:
· The client establishes a TCP connection to the server through the TCP/IP protocol
· The client sends an HTTP protocol request packet to the server, requesting a resource document from the server
· The server sends an HTTP protocol reply packet to the client if the requested resource contains content that is in dynamic language.
Then the server invokes the dynamic language's interpretation engine to handle "dynamic content" and returns the processed data to the client
· The client and server are disconnected. The client interprets the HTML document and renders the graphic results on the client screen
A simple HTTP transaction is implemented in this way and looks complicated, and the principle is actually quite simple. It is important to note that the communication between the client and the server is non-persistent, that is, when the server sends an answer, it disconnects from the client and waits for the next request.

How does the Web work, browse the Web, open a browser, enter a URL, press ENTER, and then display the content, what is the process?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.