proxy.core.connection.connection module#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

class proxy.core.connection.connection.TcpConnection(tag: int)[source]#

Bases: abc.ABC

TCP server/client connection abstraction.

Main motivation of this class is to provide a buffer management when reading and writing into the socket.

Implement the connection property abstract method to return a socket connection object.

_abc_impl = <_abc._abc_data object>#
_reusable: bool#
buffer: List[memoryview]#
close() bool[source]#
closed: bool#
abstract property connection: Union[ssl.SSLSocket, socket.socket]#

Must return the socket connection to use in this class.

flush(max_send_size: Optional[int] = None) int[source]#

Users must handle BrokenPipeError exceptions

has_buffer() bool[source]#
is_reusable() bool[source]#
mark_inuse() None[source]#
queue(mv: memoryview) None[source]#
recv(buffer_size: int = 131072) Optional[memoryview][source]#

Users must handle socket.error exceptions

reset() None[source]#
send(data: Union[memoryview, bytes]) int[source]#

Users must handle BrokenPipeError exceptions

tag: str#
exception proxy.core.connection.connection.TcpConnectionUninitializedException[source]#

Bases: Exception