usar un timeout de TLS más alto

This commit is contained in:
Cat /dev/Nulo 2023-01-20 16:29:22 -03:00
parent 61142dd767
commit acdf974adc

14
main.go
View file

@ -3,15 +3,29 @@ package main
import ( import (
"io" "io"
"log" "log"
"net"
"net/http" "net/http"
"os" "os"
"strings" "strings"
"time"
) )
func main() { func main() {
entries := os.Args[1:] entries := os.Args[1:]
c := make(chan error) c := make(chan error)
d := Downloader{} 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 { for _, u := range entries {
splits := strings.Split(u, ";") splits := strings.Split(u, ";")
url := splits[0] url := splits[0]