MCPcopy
hub / github.com/mitmproxy/mitmproxy / make

Function make

web/gen/tflow_js.py:18–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18async def make() -> str:
19 tf_http = tflow.tflow(resp=True, err=True, ws=True)
20 tf_http.id = "d91165be-ca1f-4612-88a9-c0f8696f3e29"
21 tf_http.client_conn.id = "4a18d1a0-50a1-48dd-9aa6-d45d74282939"
22 tf_http.server_conn.id = "f087e7b2-6d0a-41a8-a8f0-e1a4761395f8"
23 tf_http.server_conn.certificate_list = [
24 certs.Cert.from_pem(
25 (
26 here / "../../test/mitmproxy/net/data/verificationcerts/self-signed.pem"
27 ).read_bytes()
28 )
29 ]
30 tf_http.request.trailers = Headers(trailer="qvalue")
31 tf_http.response.trailers = Headers(trailer="qvalue")
32 tf_http.comment = "I'm a comment!"
33
34 tf_tcp = tflow.ttcpflow(err=True)
35 tf_tcp.id = "2ea7012b-21b5-4f8f-98cd-d49819954001"
36 tf_tcp.client_conn.id = "8be32b99-a0b3-446e-93bc-b29982fe1322"
37 tf_tcp.server_conn.id = "e33bb2cd-c07e-4214-9a8e-3a8f85f25200"
38
39 tf_udp = tflow.tudpflow(err=True)
40 tf_udp.id = "f9f7b2b9-7727-4477-822d-d3526e5b8951"
41 tf_udp.client_conn.id = "0a8833da-88e4-429d-ac54-61cda8a7f91c"
42 tf_udp.server_conn.id = "c49f9c2b-a729-4b16-9212-d181717e294b"
43
44 tf_dns = tflow.tdnsflow(resp=True, err=True)
45 tf_dns.id = "5434da94-1017-42fa-872d-a189508d48e4"
46 tf_dns.client_conn.id = "0b4cc0a3-6acb-4880-81c0-1644084126fc"
47 tf_dns.server_conn.id = "db5294af-c008-4098-a320-a94f901eaf2f"
48
49 # language=TypeScript
50 content = (
51 "/** Auto-generated by web/gen/tflow_js.py */\n"
52 "import type {HTTPFlow, TCPFlow, UDPFlow, DNSFlow} from '../../flow';\n"
53 "export function THTTPFlow(): Required<HTTPFlow> {\n"
54 " return %s\n"
55 "}\n"
56 "export function TTCPFlow(): Required<TCPFlow> {\n"
57 " return %s\n"
58 "}\n"
59 "export function TUDPFlow(): Required<UDPFlow> {\n"
60 " return %s\n"
61 "}\n"
62 "export function TDNSFlow(): Required<DNSFlow> {\n"
63 " return %s\n"
64 "}\n"
65 % (
66 textwrap.indent(
67 json.dumps(app.flow_to_json(tf_http), indent=4, sort_keys=True), " "
68 ),
69 textwrap.indent(
70 json.dumps(app.flow_to_json(tf_tcp), indent=4, sort_keys=True), " "
71 ),
72 textwrap.indent(
73 json.dumps(app.flow_to_json(tf_udp), indent=4, sort_keys=True), " "
74 ),
75 textwrap.indent(

Callers 1

tflow_js.pyFile · 0.70

Calls 4

HeadersClass · 0.90
from_pemMethod · 0.80
dumpsMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…