Increase timeout period to prevent some clients from stopping playback.

This commit is contained in:
2025-09-13 23:20:38 +08:00
parent 84bc9ac583
commit 1030810d59

View File

@@ -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