官术网_书友最值得收藏!

Transport level 

This section shows the way the connection is created between the browser and the web server. The flowchart shows the process in some detail. 

When we start the connection by entering the URL into a browser, the following things happen to create the connection: 

  1. The browser checks for the presence of a proxy configuration (Manual or Proxy Auto-Configuration (PAC) file). 
  2. If there is a proxy present, the browser simply submits its request to the proxy and the proxy, after checking its policy, also serves the website back by following through point-3 onwards. 
  3. If the proxy is not present, then the browser requests for the DNS resolution to change the host name into the IP address:
    1. The local cache is checked for the IP. 
    2. If the IP is present in the local cache, the TTL value is checked and if the Time to Live (TTL) has expired, then the DNS query is made to the primary DNS server configured.
    3. If the IP is not present, then the DNS query is also made to the primary DNS server that is configured. 
  4. Once the IP is found, a TCP connection is made. Default values are port 80 for HTTP, port 443 for HTTPS.
    1. The TCP connection is done by way of the TCP 3-way handshake. 
    2. For HTTPS, the TCP handshake is followed by an SSL handshake.
  5. Once the connection is successful, the HTTP request is sent to the web server, which then sends an appropriate response back to the system.
The HTTP protocol mainly uses the following reference implementations: HTTP/1.0, HTTP/1.1, and HTTP/2.0. While HTTP 2 support was added to most browsers by the end of 2015, the most used protocol still happens to be HTTP/1.1.

Optional:

To understand this better, the following example emulates connecting to www.google.com and requesting the / (index) page, with and without a proxy. This can be done from any terminal (Command Prompt in Windows and terminal/ssh in Linux or macOS). You should ensure that the telnet client is installed as that will allow us to emulate a TCP connection without having to write our own socket program. 

The following commands are also used to test the connectivity to the website, and may prove useful in troubleshooting the applications, regardless of where it is hosted. 
主站蜘蛛池模板: 永胜县| 车致| 枣强县| 阿拉善左旗| 佛冈县| 北海市| 大姚县| 合江县| 洛扎县| 潢川县| 襄城县| 松阳县| 启东市| 黄大仙区| 府谷县| 牙克石市| 平乡县| 高尔夫| 灵璧县| 石阡县| 鸡西市| 汉沽区| 南丹县| 阿克陶县| 含山县| 北流市| 新和县| 南丰县| 措美县| 图木舒克市| 双牌县| 色达县| 高雄市| 淳安县| 大悟县| 邹城市| 噶尔县| 丰台区| 涞源县| 祁门县| 肃宁县|