mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 09:37:55 +08:00
34 lines
727 B
Go
34 lines
727 B
Go
package common
|
|
|
|
import (
|
|
"net/http"
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
var HTTPClient = http.Client{
|
|
Timeout: 5 * time.Hour,
|
|
Transport: &http.Transport{
|
|
Dial: (&net.Dialer{
|
|
Timeout: 10 * time.Second,
|
|
KeepAlive: 10 * time.Second,
|
|
}).Dial,
|
|
TLSHandshakeTimeout: 5 * time.Second,
|
|
IdleConnTimeout: 60 * time.Second,
|
|
ResponseHeaderTimeout: 60 * time.Second,
|
|
},
|
|
}
|
|
|
|
var HTTP = http.Client{
|
|
Timeout: 10000 * time.Millisecond,
|
|
Transport: &http.Transport{
|
|
Dial: (&net.Dialer{
|
|
Timeout: 5000 * time.Millisecond,
|
|
KeepAlive: 5000 * time.Millisecond,
|
|
}).Dial,
|
|
TLSHandshakeTimeout: 5000 * time.Millisecond,
|
|
IdleConnTimeout: 5000 * time.Millisecond,
|
|
ResponseHeaderTimeout: 5000 * time.Millisecond,
|
|
},
|
|
}
|