Skip to content

Commit

Permalink
🎨 Support for H2C (HTTP/2 over cleartext) (#11116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuoqiu-Yingyi authored Apr 23, 2024
1 parent 398fdf1 commit 25ac2c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/server/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var cookieStore = cookie.NewStore([]byte("ATN51UlxVq1Gcvdf"))
func Serve(fastMode bool) {
gin.SetMode(gin.ReleaseMode)
ginServer := gin.New()
ginServer.UseH2C = true
ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023
ginServer.Use(
model.ControlConcurrency, // 请求串行化 Concurrency control when requesting the kernel API https://github.com/siyuan-note/siyuan/issues/9939
Expand Down Expand Up @@ -135,7 +136,7 @@ func Serve(fastMode bool) {

go util.HookUILoaded()

if err = http.Serve(ln, ginServer); nil != err {
if err = http.Serve(ln, ginServer.Handler()); nil != err {
if !fastMode {
logging.LogErrorf("boot kernel failed: %s", err)
os.Exit(logging.ExitCodeUnavailablePort)
Expand Down

0 comments on commit 25ac2c0

Please sign in to comment.