http relevant knowledge review

I. Overview

1. What is HTTP

HTTP is a HTML can obtain such a network resource communication protocol protocol. Data exchange is based on the WEB, a client - server protocol. HTTP is a scalable application layer protocol over TCP or TCP connection TLS- encrypted transmission.

2, HTTP-based component of the system

HTTP is a client-server protocol: request is issued by an entity, the entity is a user agent (browser mostly refers to, or may be a web crawler to generate machine maintenance machine index crawler)

Figure: client ---> proxy ----> protoxy ---> server

   client<---proxy<---protoxy<---server

When the user initiates a request to the server, the server will be processed, and returns a Response message ---

Indeed. Between the browser and the server process requests, as well as a router, modem. As the web development web-based level design. Those details at the network layer and the transport layer are hidden. HTTP application layer located at the uppermost booklet. While the bottom is important, but the front-end, the most independent of the underlying and HTTP

3, the client:

user-agent 就是能够为用户发起的为的工具。浏览器总是作为发起一个请求的实体,永远不是服务器。要展现一个网页,浏览器首先发送一个请求来获取页面的HTML文档,再解析文档中的资源信息发送其他请求,获取可执行脚本或CSS样式来进行页面布局渲染,以及一些其它页面资源(如图片和视频等)。然后,浏览器将这些资源整合到一起,展现出一个完整的文档,也就是网页。浏览器执行的脚本可以在之后的阶段获取更多资源,并相应地更新网页。

  The browser is responsible for sending HTTP requests and HTTP return further parse information in order to provide a clear response to the user.

4, Web server

  At the other end client communication process, there is a Web Server to serve and provide the documentation requested by the client.

5, agents (Proxies)

  Between the browser and the server, the HTTP message forwarding many devices, due to the stack hierarchy of Web, T most of them appear at the transport layer, network layer and the physical layer, the application layer for HTTP is transparent, there part is shown in the application layer, is referred to as proxy (the Proxies). either transparent proxy performance, performance may be opaque ( "change request" does not pass through them).

  Acting roles: caching, filtering, parental control, load balancing, authentication, logging

Second, the basic properties of the HTTP

  HTTP is a simple, scalable, can be stateless session connection.

  Note: In the Internet, the most common transport layer protocols: TCP is reliable, UDP is not. HTTP is therefore dependent on the TCP connection-oriented message delivery, but the connection is not necessary.

     HTTP / 1.0 for each request / response are open a TCP connection, which results in two disadvantages: the need to open a TCP connection to and from multiple messaging, so slow, if multiple messages are sent periodically, this will become more efficient: warm connection is more efficient than cold connection.

  HTTP / 1.1 persistent connections and pipelining introduces: TCP connection may be the bottom layer is controlled by the Connection header. HTTP / 2.0 is connected by way of a multiplex message to make this link is always warm connection

Three, HTTP properties

缓存:服务器端告诉代理和客户端哪些文档需要缓存,缓存多久,而客户端也可以命令中间的缓存代理来忽略存储的文档。

   Open homologous limit: To prevent network eavesdropping and other privacy leak, the browser on the Web site to do a forced split restrictions, only the same source page before they can obtain all the information website

   Certification: HTTP basic authentication can be provided directly, using Authenticate header similar to, or use HTTP Cookies to set specific dialogue

  Agents and tunnel: Under normal circumstances, the server / client is in the network, the external network is to hide their real IP, so that HTTP requests through a proxy is to cross this barrier network, but not all agents are HTTP proxy.

   Session: Using HTTP Cookies allow you to initiate a request with a server-side state, you create a session.

Three, HTTP streaming --- client and server interaction

打开一个TCP连接---->发送一个HTTP报文--->读取服务器端返回的报文信息--->关闭连接或为后续的请求重用连接

HTTP流水线已被HTTP/2的帧替代

Four, HTTP packets

  1, there are two types of HTTP messages: request and response

   请求:

image description

image description

   Response:

image description

HTTP / 1.0 and HTTP / 1.1 distinction

1, supports virtual mainframe technology, the coexistence of multiple domain sites on a WEB server;

2, support for persistent connections: three-way handshake, waving four times. The client and server connections you want to save some time Conection: Keep-alive

3, support for proxy connections

4, HTTP 1.1 also provides information on the identity, status management and Cache caching mechanism of request headers and response headers.

User input in the browser www.baidu.com between pages until you see what happened?

① operating system access to the DNS server, the domain name into an IP address

② browser sends an HTTP request

③ find the specified resource may access the database, build and returns an HTTP response message

④ browser receives and parses the message

⑤ browser cache receives the content of the response, parse and render the corresponding content

    

    

Guess you like

Origin www.cnblogs.com/baimeishaoxia/p/11851712.html