You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
332 B

  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. }