2021-09-03 10:26:29 +08:00
|
|
|
//go:build !windows
|
2020-06-30 12:43:21 +08:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2021-11-05 13:03:31 +08:00
|
|
|
"time"
|
|
|
|
|
2020-06-30 12:43:21 +08:00
|
|
|
"github.com/fvbock/endless"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func initServer(address string, router *gin.Engine) server {
|
|
|
|
s := endless.NewServer(address, router)
|
2021-11-19 22:20:04 +08:00
|
|
|
s.ReadHeaderTimeout = 20 * time.Second
|
|
|
|
s.WriteTimeout = 20 * time.Second
|
2020-06-30 12:43:21 +08:00
|
|
|
s.MaxHeaderBytes = 1 << 20
|
|
|
|
return s
|
2021-04-04 21:32:23 +08:00
|
|
|
}
|