mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
Add easy way to set Read/WriteTimeout instead of http://targetliu.com/golang-iriszhong-tong-guo-pluginshe-zhi-httpchao-shi-shi-jian/
Instead of this article, I just found, shows you how to inject the main
server, now you can just use the:
iris.ListenTo(config.Server{WriteTimeout: 5* time.Second, ReadTimeout=
5*time.Second, ListeningAddr:":8080"})
This commit is contained in:
3
http.go
3
http.go
@@ -434,7 +434,8 @@ func (s *Server) Open(h fasthttp.RequestHandler) error {
|
||||
s.Server.MaxRequestBodySize = s.Config.MaxRequestBodySize
|
||||
s.Server.ReadBufferSize = s.Config.ReadBufferSize
|
||||
s.Server.WriteBufferSize = s.Config.WriteBufferSize
|
||||
|
||||
s.Server.ReadTimeout = s.Config.ReadTimeout
|
||||
s.Server.WriteTimeout = s.Config.WriteTimeout
|
||||
if s.Config.RedirectTo != "" {
|
||||
// override the handler and redirect all requests to this addr
|
||||
s.Server.Handler = func(reqCtx *fasthttp.RequestCtx) {
|
||||
|
||||
Reference in New Issue
Block a user