HTTP connections consume resources

Why is that? Because three handshakes.

Establishing AN HTTP/TCP connection: What is the three-way handshake? Why three shakes?

What is a three-way handshake? 1. The client sends data to the server. The server receives data. // First handshake success: the server receives data and sends a response. 2. The server sends data to the client. The client receives data. // The second handshake succeeds: the client receives data. 3. The client sends data to the server. The client sends data again and the server receives the data. // The third handshake succeeds: the client sends response data.

Why three shakes? 1. The server receives data and sends a response. 2. The client receives data and sends a response.


When will the actual transmission of data begin? The packet transmitted during the handshake does not contain data. After three handshakes, the client and server start data transmission.

Disconnecting HTTP/TCP connections: What are 4 breakups? Why four times?

What are four breakups? 1. The client sends data (disconnect request) 2. The server receives data (disconnect request) 3. 4. The client receives data (agrees to disconnect) // At this point, the client disconnects from the server


Why do you need four? Both parties send disconnection requests to each other and need confirmation from the other party before they can finally disconnect.

Application scenarios

Used for duplex communication between web browsers and Web servers.

https

What is? HTTP + SSL.


Only the client and server can encrypt and decrypt data during transmission.


SSL Secure Socket Layer.

Based on the TCP

HTTP is an application layer protocol. Based on the transport layer protocol TCP.

The socket socket

Socket is the cornerstone of communication and the basic operation unit of network communication that supports TCP/IP protocol.

It is an abstract representation of the endpoint in the process of network communication, and contains five necessary information for network communication: the protocol used for connection, the IP address of the local host, the protocol port of the local process, the IP address of the remote host, and the protocol port of the remote process.

reference

Github.com/jawil/blog/…