Skip to content

Commit

Permalink
set read and write timeouts to 0 to disable
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Dec 18, 2020
1 parent 894b1d1 commit a5b5ed5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cmd/jwtpxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,16 @@ func main() {

// Proxy Server
pxySrv := &http.Server{
Addr: *ip + ":" + *port,
Handler: pMux,
ReadTimeout: time.Duration(*readTimeout) * time.Second,
WriteTimeout: time.Duration(*writeTimeout) * time.Second,
Addr: *ip + ":" + *port,
Handler: pMux,
}

if *readTimeout > 0 {
pxySrv.ReadTimeout = time.Duration(*readTimeout) * time.Second
}

if *writeTimeout > 0 {
pxySrv.WriteTimeout = time.Duration(*writeTimeout) * time.Second
}

// util mux
Expand Down

0 comments on commit a5b5ed5

Please sign in to comment.