MCPcopy Create free account
hub / github.com/Azure/peerd / HTTPClientFor

Method HTTPClientFor

pkg/peernet/network.go:58–67  ·  view source on GitHub ↗

HTTPClientFor returns a single use HTTP client for the given peer. The client does not verify the peer's certificate.

(pid peer.ID)

Source from the content-addressed store, hash-verified

56// HTTPClientFor returns a single use HTTP client for the given peer.
57// The client does not verify the peer's certificate.
58func (n *network) HTTPClientFor(pid peer.ID) *http.Client {
59 if pid == "" {
60 return defaultHttpClient
61 }
62
63 return &http.Client{
64 Transport: n.transportFor(pid),
65 Timeout: defaultTimeout,
66 }
67}
68
69// RoundTripperFor returns a single use round tripper for the given peer.
70// The peer is expected to provide a valid certificate.

Callers

nothing calls this directly

Calls 1

transportForMethod · 0.95

Tested by

no test coverage detected