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 (
|
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]
|
||||||
|
|
Loading…
Reference in a new issue