MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewHTTPClient

Function NewHTTPClient

internal/utils/http.go:27–42  ·  view source on GitHub ↗

NewHTTPClient 获取一个新的Client

(timeout time.Duration)

Source from the content-addressed store, hash-verified

25
26// NewHTTPClient 获取一个新的Client
27func NewHTTPClient(timeout time.Duration) *http.Client {
28 return &http.Client{
29 Timeout: timeout,
30 Transport: &http.Transport{
31 MaxIdleConns: 4096,
32 MaxIdleConnsPerHost: 32,
33 MaxConnsPerHost: 32,
34 IdleConnTimeout: 2 * time.Minute,
35 ExpectContinueTimeout: 1 * time.Second,
36 TLSHandshakeTimeout: 10 * time.Second,
37 TLSClientConfig: &tls.Config{
38 InsecureSkipVerify: true,
39 },
40 },
41 }
42}
43
44// SharedHttpClient 获取一个公用的Client
45func SharedHttpClient(timeout time.Duration) *http.Client {

Callers 2

SharedHttpClientFunction · 0.70
TestNewHTTPClientFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestNewHTTPClientFunction · 0.56