MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_reverse_dns

Function test_reverse_dns

test/mitmproxy/proxy/layers/test_modes.py:174–193  ·  view source on GitHub ↗
(tctx)

Source from the content-addressed store, hash-verified

172
173
174def test_reverse_dns(tctx):
175 tctx.client.transport_protocol = "udp"
176 tctx.server.transport_protocol = "udp"
177
178 f = Placeholder(dns.DNSFlow)
179 server = Placeholder(Server)
180 tctx.client.proxy_mode = ProxyMode.parse("reverse:dns://8.8.8.8:53")
181 tctx.options.connection_strategy = "lazy"
182 assert (
183 Playbook(modes.ReverseProxy(tctx), hooks=False)
184 >> DataReceived(tctx.client, tflow.tdnsreq().packed)
185 << NextLayerHook(Placeholder(NextLayer))
186 >> reply_next_layer(layers.DNSLayer)
187 << layers.dns.DnsRequestHook(f)
188 >> reply(None)
189 << OpenConnection(server)
190 >> reply(None)
191 << SendData(tctx.server, tflow.tdnsreq().packed)
192 )
193 assert server().address == ("8.8.8.8", 53)
194
195
196@pytest.mark.parametrize("keep_host_header", [True, False])

Callers

nothing calls this directly

Calls 9

PlaceholderFunction · 0.90
PlaybookClass · 0.90
DataReceivedClass · 0.90
NextLayerHookClass · 0.90
reply_next_layerFunction · 0.90
replyClass · 0.90
OpenConnectionClass · 0.90
SendDataClass · 0.90
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…