HTTP请求过程

1.url的组成

http://127.0.0.1:9000/index.html

第一部分:http://:协议 protocol

第二部分:127.0.0.1:9000:domain name 域名,一般是www.example.com样子。

第三部分:/index.html:是路径path,需要寻找的文件的路径

2. 过程

第一步:寻找地址:通过www.example.com寻找服务器的ip和port地址,socket连接需要。

静态地址:从本机的host.txt或者/etc/host中寻找。

动态地址:从DNS服务器上寻找。

# TODO

原文地址:https://www.cnblogs.com/meloncodezhang/p/14806608.html