Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SOCKS5 ports to sentry reporter #7884

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from tribler.core.utilities.network_utils import default_network_utils

NUM_SOCKS_PROXIES = 5
SOCKS5_SERVER_PORTS = 'socks5_server_ports'


class SocksServersComponent(Component):
Expand All @@ -31,6 +32,9 @@ async def run(self):

self.logger.info(f'Socks listen port: {self.socks_ports}')

# Set the SOCKS5 server ports in the reporter for debugging Network errors
self.reporter.additional_information[SOCKS5_SERVER_PORTS] = self.socks_ports

async def shutdown(self):
for socks_server in self.socks_servers:
await socks_server.stop()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tribler.core.components.session import Session
from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent
from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent, SOCKS5_SERVER_PORTS


# pylint: disable=protected-access
Expand All @@ -10,3 +10,4 @@ async def test_socks_servers_component(tribler_config):
assert comp.started_event.is_set() and not comp.failed
assert comp.socks_ports
assert comp.socks_servers
assert comp.reporter.additional_information[SOCKS5_SERVER_PORTS] == comp.socks_ports
Loading