MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_socks5_trickle

Function test_socks5_trickle

test/mitmproxy/proxy/layers/test_modes.py:417–434  ·  view source on GitHub ↗
(tctx: Context)

Source from the content-addressed store, hash-verified

415
416
417def test_socks5_trickle(tctx: Context):
418 ProxyAuth().load(tctx.options)
419 tctx.options.proxyauth = "user:password"
420 tctx.options.connection_strategy = "lazy"
421 playbook = Playbook(modes.Socks5Proxy(tctx))
422 for x in b"\x05\x01\x02":
423 playbook >> DataReceived(tctx.client, bytes([x]))
424 playbook << SendData(tctx.client, b"\x05\x02")
425 for x in b"\x01\x04user\x08password":
426 playbook >> DataReceived(tctx.client, bytes([x]))
427 playbook << modes.Socks5AuthHook(Placeholder())
428 playbook >> reply(side_effect=_valid_socks_auth)
429 playbook << SendData(tctx.client, b"\x01\x00")
430 for x in b"\x05\x01\x00\x01\x7f\x00\x00\x01\x12\x34":
431 playbook >> DataReceived(tctx.client, bytes([x]))
432 assert playbook << SendData(
433 tctx.client, b"\x05\x00\x00\x01\x00\x00\x00\x00\x00\x00"
434 )
435
436
437@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 7

ProxyAuthClass · 0.90
PlaybookClass · 0.90
DataReceivedClass · 0.90
SendDataClass · 0.90
PlaceholderFunction · 0.90
replyClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…