Browse Source
Merge pull request #790 from liqianjie/master
不通过本地nginx代理,直接访问时,10ms会导致概率性请求失败
main
奇淼(piexlmax
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
server/core/server_other.go
|
@ -4,14 +4,15 @@ |
|
|
package core |
|
|
package core |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/fvbock/endless" |
|
|
"github.com/fvbock/endless" |
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
|
"time" |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func initServer(address string, router *gin.Engine) server { |
|
|
func initServer(address string, router *gin.Engine) server { |
|
|
s := endless.NewServer(address, router) |
|
|
s := endless.NewServer(address, router) |
|
|
s.ReadHeaderTimeout = 10 * time.Millisecond |
|
|
|
|
|
|
|
|
s.ReadHeaderTimeout = 10 * time.Second |
|
|
s.WriteTimeout = 10 * time.Second |
|
|
s.WriteTimeout = 10 * time.Second |
|
|
s.MaxHeaderBytes = 1 << 20 |
|
|
s.MaxHeaderBytes = 1 << 20 |
|
|
return s |
|
|
return s |
|
|