bta-proxy/bta_proxy/dpi.py

19 lines
509 B
Python
Raw Normal View History

2023-08-25 21:49:10 +03:00
from asyncio.queues import Queue
from bta_proxy.datainputstream import AsyncDataInputStream
from bta_proxy.packets.base import Packet
async def inspect_client(queue: Queue, addr: tuple[str, int]):
dis = AsyncDataInputStream(queue)
while True:
pkt = await Packet.read_packet(dis)
print("C", pkt)
async def inspect_server(queue: Queue, addr: tuple[str, int]):
dis = AsyncDataInputStream(queue)
while True:
pkt = await Packet.read_packet(dis)
print("S", pkt)