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

Function newTestHTTP2Connection

connection/http2_test.go:32–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30var testTransport = http2.Transport{}
31
32func newTestHTTP2Connection() (*HTTP2Connection, net.Conn) {
33 edgeConn, cfdConn := net.Pipe()
34 connIndex := uint8(0)
35 log := zerolog.Nop()
36 obs := NewObserver(&log, &log)
37 controlStream := NewControlStream(
38 obs,
39 mockConnectedFuse{},
40 &TunnelProperties{},
41 connIndex,
42 nil,
43 nil,
44 1*time.Second,
45 nil,
46 1*time.Second,
47 HTTP2,
48 )
49 return NewHTTP2Connection(
50 cfdConn,
51 // OriginProxy is set in testConfigManager
52 testOrchestrator,
53 &client.ConnectionOptionsSnapshot{},
54 obs,
55 connIndex,
56 controlStream,
57 &log,
58 ), edgeConn
59}
60
61func TestHTTP2ConfigurationSet(t *testing.T) {
62 http2Conn, edgeConn := newTestHTTP2Connection()

Callers 9

TestServeHTTPFunction · 0.85
TestServeWSFunction · 0.85
TestServeControlStreamFunction · 0.85
TestFailRegistrationFunction · 0.85
TestServeTCP_RateLimitedFunction · 0.85
benchmarkServeHTTPFunction · 0.85

Calls 3

NewObserverFunction · 0.85
NewControlStreamFunction · 0.85
NewHTTP2ConnectionFunction · 0.85

Tested by

no test coverage detected