Increase timeout period to prevent some clients from stopping playback.
This commit is contained in:
7
main.go
7
main.go
@@ -40,8 +40,11 @@ func main() {
|
||||
// Create a server instance
|
||||
srv := &http.Server{
|
||||
Addr: ":" + port,
|
||||
ReadTimeout: 5 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
ReadTimeout: 30 * time.Second,
|
||||
WriteTimeout: 0, // Disable the timeout for the response writer
|
||||
IdleTimeout: 30 * time.Minute, // Set the maximum duration for idle connections
|
||||
ReadHeaderTimeout: 10 * time.Second, // Limit the maximum duration for reading the headers of the request
|
||||
MaxHeaderBytes: 1 << 16, // Limit the maximum request header size to 64KB
|
||||
}
|
||||
|
||||
// Start the server
|
||||
|
||||
Reference in New Issue
Block a user