MCPcopy
hub / github.com/slimtoolkit/slim / getHTTPClient

Function getHTTPClient

pkg/app/master/inspectors/probes/http/httpclient.go:53–64  ·  view source on GitHub ↗
(proto string)

Source from the content-addressed store, hash-verified

51}
52
53func getHTTPClient(proto string) (*http.Client, error) {
54 switch proto {
55 case config.ProtoHTTP2:
56 return getHTTP2Client(false), nil
57 case config.ProtoHTTP2C:
58 return getHTTP2Client(true), nil
59 default:
60 return getHTTP1Client(), nil
61 }
62
63 return nil, fmt.Errorf("unsupported HTTP-family protocol %s", proto)
64}
65
66func getHTTPAddr(proto, targetHost, port string) string {
67 scheme := getHTTPScheme(proto)

Callers 4

StartMethod · 0.85
loadAPISpecsMethod · 0.85
probeAPISpecEndpointsMethod · 0.85
crawlMethod · 0.85

Calls 2

getHTTP2ClientFunction · 0.85
getHTTP1ClientFunction · 0.85

Tested by

no test coverage detected