MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / start_h2_client

Function start_h2_client

test/mitmproxy/proxy/layers/http/test_http2.py:71–85  ·  view source on GitHub ↗
(tctx: Context, keepalive: int = 0)

Source from the content-addressed store, hash-verified

69
70
71def start_h2_client(tctx: Context, keepalive: int = 0) -> tuple[Playbook, FrameFactory]:
72 tctx.client.alpn = b"h2"
73 tctx.options.http2_ping_keepalive = keepalive
74 frame_factory = FrameFactory()
75
76 playbook = Playbook(http.HttpLayer(tctx, HTTPMode.regular))
77 assert (
78 playbook
79 << SendData(tctx.client, Placeholder()) # initial settings frame
80 >> DataReceived(tctx.client, frame_factory.preamble())
81 >> DataReceived(
82 tctx.client, frame_factory.build_settings_frame({}, ack=True).serialize()
83 )
84 )
85 return playbook, frame_factory
86
87
88def make_h2(open_connection: OpenConnection) -> None:

Callers 15

_test_cancelFunction · 0.90
test_simpleFunction · 0.85
test_response_trailersFunction · 0.85
test_request_trailersFunction · 0.85
test_upstream_errorFunction · 0.85
test_long_responseFunction · 0.85
test_http2_client_abortsFunction · 0.85
test_no_normalizationFunction · 0.85
test_rst_then_closeFunction · 0.85

Calls 7

preambleMethod · 0.95
build_settings_frameMethod · 0.95
FrameFactoryClass · 0.90
PlaybookClass · 0.90
SendDataClass · 0.90
PlaceholderFunction · 0.90
DataReceivedClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…