tribler.core.tunnel.community
Attributes
Classes
Settings for Tribler's tunnel community. |
|
This community is built upon the anonymous messaging layer in IPv8. |
Functions
|
Returns True is x appears to be valid bencoded byte string. |
Module Contents
- tribler.core.tunnel.community.DESTROY_REASON_BALANCE = 65535
- tribler.core.tunnel.community.PEER_FLAG_EXIT_HTTP = 32768
- tribler.core.tunnel.community.PEER_FLAG_EXIT_BACKUP = 16384
- tribler.core.tunnel.community.MAX_HTTP_PACKET_SIZE = 1400
- tribler.core.tunnel.community.is_bencoded(x: bytes) bool
Returns True is x appears to be valid bencoded byte string.
- class tribler.core.tunnel.community.TriblerTunnelSettings
Bases:
ipv8.messaging.anonymization.hidden_services.HiddenTunnelSettingsSettings for Tribler’s tunnel community.
- exitnode_cache: pathlib.Path | None = None
- notifier: tribler.core.notifier.Notifier
- class tribler.core.tunnel.community.TriblerTunnelCommunity(settings: TriblerTunnelSettings)
Bases:
ipv8.messaging.anonymization.hidden_services.HiddenTunnelCommunityThis community is built upon the anonymous messaging layer in IPv8. It adds support for libtorrent anonymous downloads.
- community_id
- settings_class
- bittorrent_peers: dict[tribler.core.libtorrent.download_manager.download.Download, set[tuple[str, int]]]
- download_states: dict[bytes, tribler.core.libtorrent.download_manager.download_state.DownloadStatus]
- cache_exitnodes_to_disk() None
Write a copy of the exit_candidates to the file self.settings.exitnode_cache.
- restore_exitnodes_from_disk() None
Send introduction requests to peers stored in the file self.settings.exitnode_cache.
- get_candidates(*requested_flags: int) list[ipv8.peer.Peer]
Get all the peers that we can create circuits with. When requesting exits, prefer peers that aren’t backups.
- async should_join_circuit(create_payload: ipv8.messaging.anonymization.payload.CreatePayload, previous_node_address: ipv8.messaging.interfaces.udp.endpoint.Address) bool
Check whether we should join a circuit. Returns a future that fires with a boolean.
- update_torrent(peers: set[tuple[str, int]], download: tribler.core.libtorrent.download_manager.download.Download) None
Ensure that the given peers are registered in the given download.
- async remove_circuit(circuit_id: int, additional_info: str = '', remove_now: bool = False, destroy: bool | int = False) None
Remove the circuit that belongs to the given circuit id.
- async remove_relay(circuit_id: int, additional_info: str = '', remove_now: bool = False, destroy: bool = False) None
Callback for when a relay is removed.
- async remove_exit_socket(circuit_id: int, additional_info: str = '', remove_now: bool = False, destroy: bool = False) ipv8.messaging.anonymization.exit_socket.TunnelExitSocket | None
Remove the exit socket that belongs to the given circuit id.
- _ours_on_created_extended(circuit_id: int, payload: ipv8.messaging.anonymization.payload.CreatedPayload | ipv8.messaging.anonymization.payload.ExtendedPayload) None
Callback for when we receive either a Created or and Extended payload.
- on_raw_data(circuit: ipv8.messaging.anonymization.tunnel.Circuit, origin: tuple[str, int], data: bytes) None
We have incoming data.
- monitor_downloads(dslist: list[tribler.core.libtorrent.download_manager.download_state.DownloadState]) None
Periodically check the Tribler downloads for state changes.
Update the known swarms based on the changed states.
- on_e2e_finished(address: ipv8.messaging.interfaces.udp.endpoint.Address, info_hash: bytes) None
Callback for when an end-to-end connection has been established.
- get_download(lookup_info_hash: bytes) tribler.core.libtorrent.download_manager.download.Download | None
Match the given infohash to a download (or None if it cannot be found).
- introduction_response_callback(peer: ipv8.peer.Peer, dist: ipv8.messaging.payload_headers.GlobalTimeDistributionPayload, payload: ipv8.messaging.payload.IntroductionResponsePayload | ipv8.messaging.payload.NewIntroductionResponsePayload) None
Try to discover peers that are behind a different port.