【文件属性】:
文件名称:go-nghttp2:使用 nghttp2 C 库在 golang 中实现 HTTP2
文件大小:17KB
文件格式:ZIP
更新时间:2021-06-05 22:00:48
Go
go-nghttp2
使用 cgo 使用 Go 中的 nghttp2 C 库的实验项目。 目前,服务器实现可用。
如何运行演示服务器
首先,构建并安装 。 执行 git clone 并进入演示目录。 然后运行go run demo.go 。 它启动了在端口 3000 上侦听支持 HTTP/2 的 https 服务器。它还支持 HTTP/1 连接。
nghttp2.Server 目前只支持 https HTTP/2 连接。
例子
package main
import (
"github.com/tatsuhiro-t/go-nghttp2"
"io"
"log"
"net/http"
)
func main () {
var srv http. Server
srv . Addr = "l
【文件预览】:
go-nghttp2-master
----README.rst(1KB)
----server.go(10KB)
----cnghttp2.h(2KB)
----session.go(11KB)
----stream.go(6KB)
----.gitignore(3B)
----nghttp2.c(3KB)
----demo()
--------demo.go(2KB)
--------server.crt(1KB)
--------server.key(2KB)