2019-10-05 21:53:22 +05:00
|
|
|
package requester
|
|
|
|
|
|
|
|
import (
|
|
|
|
// stdlib
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func getHTTPClient() *http.Client {
|
|
|
|
c := &http.Client{
|
|
|
|
Transport: &http.Transport{
|
|
|
|
ExpectContinueTimeout: time.Second * 5,
|
|
|
|
DialContext: (&net.Dialer{
|
|
|
|
Timeout: time.Second * 5,
|
|
|
|
}).DialContext,
|
|
|
|
ResponseHeaderTimeout: time.Second * 5,
|
2019-10-07 22:33:05 +05:00
|
|
|
TLSHandshakeTimeout: time.Second * 10,
|
2019-10-05 21:53:22 +05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return c
|
|
|
|
}
|