mitmproxy_rs
1import sys 2import types 3 4from .mitmproxy_rs import * 5 6__doc__ = mitmproxy_rs.__doc__ 7if hasattr(mitmproxy_rs, "__all__"): 8 __all__ = mitmproxy_rs.__all__ 9 10# Hacky workaround for https://github.com/PyO3/pyo3/issues/759 11for k, v in vars(mitmproxy_rs).items(): 12 if isinstance(v, types.ModuleType): 13 sys.modules[f"mitmproxy_rs.{k}"] = v
An individual TCP or UDP stream with an API that is similar to
asyncio.StreamReader
and asyncio.StreamWriter
from the Python standard library.
Read up to n
bytes of a TCP stream, or a single UDP packet (n
is ignored for UDP).
Return an empty bytes
object if the connection was closed
or the server has been shut down.
Write bytes onto the TCP stream, or send a single UDP packet.
For TCP, this queues the data into a write buffer. To wait until the stream can be written
to again, await Stream.drain
.
Raises: OSError if the connection has previously been closed or if server has been shut down.
Wait until the stream can be written to again.
Raises: OSError if the stream is closed or the server has been shut down.
Close the TCP stream after flushing the write buffer. This method is a no-op for UDP streams, but may still raise an error (see below).
Raises: OSError if the server has been shut down.