- [x] Have a different branch
- [x] Generate "mock" certs
- [x] Implement Go
- [x] Implement in Node - see https://github.com/ericmdantas/generator-ng-fullstack/issues/96#issuecomment-197285514
- [x] Create options (http or http2)
- [x] Cleanup
Implement http2 server
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
7条回答 默认 最新
weixin_39732866 2020-11-19 11:29关注Go server:
go package main import ( "fmt" "net/http" "golang.org/x/net/http2" ) func main() { var srv http.Server http2.VerboseLogs = true srv.Addr = ":3333" http2.ConfigureServer(&srv, nil) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("yo!")) }) log.Fatal(srv.ListenAndServeTLS("crt/server.crt", "crt/server.key")) }解决 无用评论 打赏 举报