Loading from URL input to page completion

Source: Internet
Author: User

1) divide the URL into several parts: Protocol, network address, and resource path. The Network Address indicates which computer on the connected network can be a domain name or IP address, which can include a port number. The protocol is used to obtain resources from the computer, common are HTTP and FTP, different protocols have different communication content formats. The resource path indicates which resource is obtained from the server.
Example: http://www.guokr.com/question/554991/
Protocol section: HTTP
Network Address: www.guokr.com
Path:/question/554991/

2) if the address is not an IP address, resolve it to an IP address through DNS (Domain Name System. The IP address corresponds to a computer on the network, and the DNS server itself also has an IP address. Your network settings include the IP address of the DNS server.
For example, www.guokr.com is not an IP address. Ask the DNS for the IP address corresponding to www.guokr.com and obtain the IP address 111.13.57.142. In this process, if the DNS server directly asked by your computer does not have the IP address corresponding to www.guokr.com, it will ask its higher-level server. The higher-level server may not, you can find the root node at most or not at all.

3) if the address does not contain the port number, determine one according to the default port number of the Protocol. The port number is for a computer, just like a window number for a bank. A bank has multiple windows and each window has a number. Different windows can be used for different services. A port is just a logical concept and has nothing to do with computer hardware.
For example, www.guokr.com does not contain the port number. The default port number of HTTP protocol is 80. If the URL you entered is http://www.guokr.com: 8080/, it means that the specified port number 8080 is used instead of the default port number.

4) Initiate a network connection to the IP address and port number identified by 2 and 3.
For example, initiate a connection to port 80 of 111.13.57.142.

5) Organize a request packet according to the HTTP protocol requirements, which contains a large amount of request information, including the requested resource path and your identity
For example, to express this packet in a natural language, it is probably the request/question/554991/, and my identity is XXXXXXX.

6) The server responds to the request and returns the data to the browser. The data may be a webpage organized according to the HTML protocol, which contains the layout and text of the page. Data may also be images, script programs, etc. Now you can use the browser's "view source code" function to feel what the server returns. If the resource indicated by the resource path does not exist, the server returns the famous 404 error.

7) if (6) a page is returned, obtain it again based on the URL of some external links and the address of the sample slice according to (1)-(6.

8) organize resources into images displayed on the screen based on the resource type. This process is called rendering. Web page rendering is the most complex and core function of the browser.

9) display the rendered page image and start responding to user operations.

Address: http://www.guokr.com/question/554991/

Loading from URL input to page completion

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.