server_other.go 353 B

123456789101112131415161718
  1. //go:build !windows
  2. // +build !windows
  3. package core
  4. import (
  5. "github.com/fvbock/endless"
  6. "github.com/gin-gonic/gin"
  7. "time"
  8. )
  9. func initServer(address string, router *gin.Engine) server {
  10. s := endless.NewServer(address, router)
  11. s.ReadHeaderTimeout = 10 * time.Millisecond
  12. s.WriteTimeout = 10 * time.Second
  13. s.MaxHeaderBytes = 1 << 20
  14. return s
  15. }