[TOC] <br/><br/><br/> # <b style="color:#4F4F4F;">简介说明</b> 原文链接: - [http2](https://github.com/nodejs/node/blob/main/doc/api/http2.md) ``` 版本:http2 作用:提供了 HTTP/2 协议的实现 ``` <br/> # <b style="color:#4F4F4F;">http2</b> <br/> # <span style="color:#619BE4">*createSecureServer()</span> ***** 创建安全服务器 <br/> ### 示例内容 <span style="color:red;">1. 举例说明</span> ``` const http2 = require("http2"); const server = http2.createSecureServer({ key: "", cert: "" }); server.listen(5000); ``` <br/> # <span style="color:#619BE4">*connect()</span> ***** 连接远程服务器 <br/> ### 示例内容 <span style="color:red;">1. 举例说明</span> ``` const http2 = require("http2"); const client = http2.connect("https:?/www.baidu.com", { ca: "" }); const req = client.request({path: "/"}); req.setEncoding("utf-8"); req.on("data", (chunk) => { console.log(chunk); }); ``` <br/> # <b style="color:#4F4F4F;">http2.Http2SecureServer</b> <br/> # <span style="color:#619BE4">[new]-Http2SecureServer()</span> ***** 安全服务器实例 <br/> # <span style="color:#619BE4">[eve]-on()</span> ***** 监听服务器事件 <br/> ### 参数说明 <b style="color:#808080;">event:</b> * 类型:字符层 * 默认值:无 * 描述: 事件类型 * 可选值:[ stream ] <br/>