MCPcopy
hub / github.com/cloudflare/cloudflared / RoundTrip

Method RoundTrip

ingress/origin_proxy.go:75–86  ·  view source on GitHub ↗
(_ *http.Request)

Source from the content-addressed store, hash-verified

73}
74
75func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
76 if o.defaultResp {
77 o.log.Warn().Msg(ErrNoIngressRulesCLI.Error())
78 }
79 resp := &http.Response{
80 StatusCode: o.code,
81 Status: fmt.Sprintf("%d %s", o.code, http.StatusText(o.code)),
82 Body: new(NopReadCloser),
83 }
84
85 return resp, nil
86}
87
88func (o *rawTCPService) EstablishConnection(ctx context.Context, dest string, logger *zerolog.Logger) (OriginConnection, error) {
89 conn, err := o.dialer.DialContext(ctx, "tcp", dest)

Callers 13

TestServeHTTPFunction · 0.45
TestServeControlStreamFunction · 0.45
TestFailRegistrationFunction · 0.45
TestServeTCP_RateLimitedFunction · 0.45
benchmarkServeHTTPFunction · 0.45
TestStaticHTTPStatusFunction · 0.45
RoundTripMethod · 0.45

Calls 1

ErrorMethod · 0.45

Tested by 11

TestServeHTTPFunction · 0.36
TestServeControlStreamFunction · 0.36
TestFailRegistrationFunction · 0.36
TestServeTCP_RateLimitedFunction · 0.36
benchmarkServeHTTPFunction · 0.36
TestStaticHTTPStatusFunction · 0.36