proxy.socks package#

Submodules#

Module contents#

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.socks.Socks4Operations(CONNECT, BIND)#

Bases: tuple

BIND: int#

Alias for field number 1

CONNECT: int#

Alias for field number 0

_asdict()#

Return a new dict which maps field names to their values.

_field_defaults = {}#
_fields = ('CONNECT', 'BIND')#
classmethod _make(iterable)#

Make a new Socks4Operations object from a sequence or iterable

_replace(**kwds)#

Return a new Socks4Operations object replacing specified fields with new values

class proxy.socks.Socks4Packet[source]#

Bases: object

SOCKS4 and SOCKS4a protocol parser.

FIXME: Currently doesn’t buffer during parsing and expects packet to arrive within a single socket receive event.

pack() bytes[source]#
parse(raw: memoryview) None[source]#
class proxy.socks.SocksClientConnection(conn: Union[ssl.SSLSocket, socket.socket], addr: Optional[Tuple[str, int]] = None)[source]#

Bases: proxy.core.connection.client.TcpClientConnection

_abc_impl = <_abc._abc_data object>#
class proxy.socks.SocksProtocolHandler(*args: Any, **kwargs: Any)[source]#

Bases: proxy.core.base.tcp_server.BaseTcpServerHandler[proxy.socks.client.SocksClientConnection]

Reference https://www.openssh.com/txt/socks4.protocol

_abc_impl = <_abc._abc_data object>#
static create(*args: Any) proxy.socks.client.SocksClientConnection[source]#

Implementations are responsible for creation of work objects from incoming args. This helps keep work core agnostic to creation of externally defined work class objects.

handle_data(data: memoryview) Optional[bool][source]#

Optionally return True to close client connection.