usar un timeout de TLS más alto
This commit is contained in:
parent
61142dd767
commit
acdf974adc
1 changed files with 14 additions and 0 deletions
14
main.go
14
main.go
|
@ -3,15 +3,29 @@ package main
|
|||
import (
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
entries := os.Args[1:]
|
||||
c := make(chan error)
|
||||
d := Downloader{}
|
||||
d.HTTPClient.Transport = &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
KeepAlive: 30 * time.Second,
|
||||
}).DialContext,
|
||||
ForceAttemptHTTP2: true,
|
||||
MaxIdleConns: 100,
|
||||
IdleConnTimeout: 90 * time.Second,
|
||||
TLSHandshakeTimeout: 90 * time.Second,
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
}
|
||||
for _, u := range entries {
|
||||
splits := strings.Split(u, ";")
|
||||
url := splits[0]
|
||||
|
|
Loading…
Reference in a new issue