server_other.go 333 B

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