tribler.core.socks5.client
Exceptions
Errors with the SOCKS5 protocol. |
Classes
A datagram protocol for Socks5 connections. |
|
This object represents a minimal Socks5 client. Both TCP and UDP are supported. |
Module Contents
- class tribler.core.socks5.client.Socks5ClientUDPConnection(callback: collections.abc.Callable[[bytes, ipv8.messaging.interfaces.udp.endpoint.DomainAddress | tuple], None])
Bases:
asyncio.DatagramProtocolA datagram protocol for Socks5 connections.
- callback
- transport: asyncio.DatagramTransport | None = None
- proxy_udp_addr: ipv8.messaging.interfaces.udp.endpoint.DomainAddress | ipv8.messaging.interfaces.udp.endpoint.UDPv4Address | None = None
- logger
- connection_made(transport: asyncio.BaseTransport) None
Callback for when a transport is available.
- class tribler.core.socks5.client.Socks5Client(proxy_addr: tuple, callback: collections.abc.Callable[[bytes, ipv8.messaging.interfaces.udp.endpoint.DomainAddress | tuple], None])
Bases:
asyncio.ProtocolThis object represents a minimal Socks5 client. Both TCP and UDP are supported.
- proxy_addr
- callback
- transport: asyncio.WriteTransport | None = None
- connection: Socks5ClientUDPConnection | None = None
- queue: asyncio.Queue[bytes]
- data_received(data: bytes) None
Callback for when data comes in. Call our registered callback or save the incoming save for calling back later.
- async _login() None
Send a login.
- Raises:
Socks5Error – If the proxy server is unsupported.
- async _associate_udp(local_addr: tuple | None = None) None
Send an associate request to the connection.
- sendto(data: bytes, target_addr: tuple) None
Attemp to send data to the given address.
- Raises:
Socks5Error – If we have not associated UDP yet.
- async connect_tcp(target_addr: tuple) None
Login and connect to the proxy using TCP.
- Raises:
Socks5Error – If we have not associated UDP yet.