chore: share some code

This commit is contained in:
wwqgtxx
2023-10-23 16:45:22 +08:00
parent f6f8f27668
commit 3564e96a00
6 changed files with 8 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import (
"net"
"net/http"
URL "net/url"
"runtime"
"strings"
"time"
@ -47,6 +48,7 @@ func HttpRequest(ctx context.Context, url, method string, header map[string][]st
transport := &http.Transport{
// from http.DefaultTransport
DisableKeepAlives: runtime.GOOS == "android",
MaxIdleConns: 100,
IdleConnTimeout: 30 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,