During HTTP communication, the following 7 steps are completed between the Web browser and the Web server: (1) establish a TCP connection before HTTP work begins, the Web browser first connects to the Web server over the network. This connection is done through TCP, which is built with the IP protocol to build the Internet, known as the TCP/IP protocol family, so the internet is also known as a TCP/IP network. HTTP is a higher level of application layer protocol than TCP, according to the rules, only the lower layer protocol is established before the connection can be more protocol, so the first to establish a TCP connection, the port number of the general TCP connection is (2) Web browser sends a request command to a Web server once a TCP connection is established, the Web browser sends a request command to the Web server for example: GET /etc/index.html http/1.1 (3) After the web browser sends the request header information The browser sends its request command, it also sends some other information to the Web server in the form of header information, and then the browser sends a blank line to notify the server that it has ended sending the header information. (4) After the web server answers the client to make a request to the server, the server will reply back to the client, the first part of http/1.1 OK answer is the protocol version number and the response status Code (5) web the server sends the reply header information as the client sends information about itself along with the request, the server also sends the user with the answer about its own data and the requested document. (6) The web server sends a data to the browser after the Web server sends the header information to the browser, it sends a blank line to indicate that the header message is sent to this end, and then It sends the actual data requested by the user in the format described in the Content-type reply header information (7) web server shuts down TCP connections in general, once the Web server sends the request data to the browser, It closes the TCP connection and then if the browser or server joins this line of code in its header connection:keep-alivetcp the connection will remain open after it is sent, the browser can continue to send the request through the same connection. Maintaining a connection saves the time it takes to establish a new connection for each request and also saves network bandwidth. Secure connection weOne of the most common uses of B applications is e-commerce, which allows people to shop online using Web server-side programs, and it's important to point out that by default, sending information over the Internet is unsafe, and if someone happens to intercept a message you've sent a friend, He can open it. The most common standard for providing secure connectivity over the Internet is the Secure Sockets Layer (secure Sockets layer,ssl) protocol. The SSL protocol is an application-layer protocol (like HTTP) that is used to securely exchange data on the Web and SSL uses a public key-encoding system. In essence, this means that each party in the business has a public and a private key. When a party encodes a public key using the other party, only the person with the matching key can decode it. In short, public key encoding provides a secure way to exchange data between two parties, after the SSL connection is established, both the client and the server exchange the public key and validate it before the business contact, and once both keys are authenticated, the data can be exchanged securely.
During HTTP communication, the following 7 steps are completed between a Web browser and a Web server