mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Support for H2C (HTTP/2 over cleartext) (#11116)
This commit is contained in:
parent
398fdf164e
commit
25ac2c0b19
1 changed files with 2 additions and 1 deletions
|
@ -50,6 +50,7 @@ var cookieStore = cookie.NewStore([]byte("ATN51UlxVq1Gcvdf"))
|
||||||
func Serve(fastMode bool) {
|
func Serve(fastMode bool) {
|
||||||
gin.SetMode(gin.ReleaseMode)
|
gin.SetMode(gin.ReleaseMode)
|
||||||
ginServer := gin.New()
|
ginServer := gin.New()
|
||||||
|
ginServer.UseH2C = true
|
||||||
ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023
|
ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023
|
||||||
ginServer.Use(
|
ginServer.Use(
|
||||||
model.ControlConcurrency, // 请求串行化 Concurrency control when requesting the kernel API https://github.com/siyuan-note/siyuan/issues/9939
|
model.ControlConcurrency, // 请求串行化 Concurrency control when requesting the kernel API https://github.com/siyuan-note/siyuan/issues/9939
|
||||||
|
@ -135,7 +136,7 @@ func Serve(fastMode bool) {
|
||||||
|
|
||||||
go util.HookUILoaded()
|
go util.HookUILoaded()
|
||||||
|
|
||||||
if err = http.Serve(ln, ginServer); nil != err {
|
if err = http.Serve(ln, ginServer.Handler()); nil != err {
|
||||||
if !fastMode {
|
if !fastMode {
|
||||||
logging.LogErrorf("boot kernel failed: %s", err)
|
logging.LogErrorf("boot kernel failed: %s", err)
|
||||||
os.Exit(logging.ExitCodeUnavailablePort)
|
os.Exit(logging.ExitCodeUnavailablePort)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue