# HTTP 协议

HTTP (HyperText Transfer Protocol)协议,超文本传输协议

## **什么是协议？**

协议这个词主要应用在计算机领域,就是连入网络的计算机都要遵循的一定的技术规范,关于硬件、软件和端口等的技术规范。计算机通信网是由许多具有信息交换和处理能力的节点互连而成的。要使整个网络有条不紊地工作, 就要求每个节点必须遵守一些事先约定好的有关数据格式及时序等的规则。 这些为实现网络数据交换而建立的规则、约定或标准就称为网络协议。

红外遥控协议：

32768Hz 闪16次，停止7.33ms，再闪16次——立即拍照

32768Hz 闪16次，停止5.36ms，再闪16次——延时5秒拍照

飞鸽传书协议：

```
1:23149:riverlet:127.0.0.1:\x20:balabalabalabala

版本号:包编号:发送者姓名:发送者主机名:命令字:附加信息（消息内容）
```

## HTTP 安全

HTTP原先 直接建立在tcp协议上

HTTPS 建立在ssl协议上,当然ssl协议也是建立在tcp协议上

SSL协议的工作流程

* 客户端向服务器请求获取证书+公钥
* 客户端通过CA验证收到证书的合法性
* 客户端通过收到的公钥加密一个字符串，作为后续通信密钥，发送给服务器
* 服务器通过私钥解密，得到通信密钥
* 后续HTTP协议通过通信密钥加密进行
* **资料:**

[http2讲解 ](https://ye11ow.gitbooks.io/http2-explained/content/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://phper.shujuwajue.com/http-xie-yi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
