server_win.go 476 B

1234567891011121314151617181920212223
  1. //go:build windows
  2. // +build windows
  3. package core
  4. import (
  5. "net/http"
  6. "time"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func initServer(address string, router *gin.Engine) server {
  10. return &http.Server{
  11. Addr: address,
  12. Handler: router,
  13. ReadTimeout: 20 * time.Second,
  14. // Streaming endpoints (for example camera MJPEG) are long-lived. A
  15. // server-wide write deadline would terminate an otherwise healthy stream.
  16. WriteTimeout: 0,
  17. MaxHeaderBytes: 1 << 20,
  18. }
  19. }