| 123456789101112131415161718192021 |
- //go:build !windows
- // +build !windows
- package core
- import (
- "time"
- "github.com/fvbock/endless"
- "github.com/gin-gonic/gin"
- )
- func initServer(address string, router *gin.Engine) server {
- s := endless.NewServer(address, router)
- s.ReadHeaderTimeout = 20 * time.Second
- // Keep streaming responses alive; individual handlers still honor request
- // cancellation when the browser closes the connection.
- s.WriteTimeout = 0
- s.MaxHeaderBytes = 1 << 20
- return s
- }
|