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
Support for IPv6 peer connections with socks5 proxy #7195
Comments
@arvidn The problem also affected me. Applying the above patch did solve my problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
sorry for the delay. This does look like a reasonable solution. |
how does this look? #7415 |
one problem with this approach, which was exposed in tests in |
here's another attempt at fixing this. I'd really appreciate it if one of you could test it! |
Please provide the following information
libtorrent version (or branch): 2.0.8
platform/architecture: Ubuntu 20.04 LTS
compiler and compiler version:
cmake version 3.16.3
gcc version 12.2.1
please describe what symptom you see, what you would expect to see instead and
how to reproduce it.
The socks proxy implementation does not work properly with IPv6 peer connection. This issue happens because libtorrent creates only one socket with default ipv4 endpoint 0.0.0.0 to listen all peers whenever a proxy was enabled. Here is the description from the libtorrent website
This setting would cause the users unable to connect to ipv6 peers since the session_impl::bind_outgoing_socket function checks if local_endpoint and remote_address belong to the same address family and otherwise fails to bind the outgoing socket to the remote address.
if (is_v4(ls->local_endpoint) != remote_address.is_v4()) continue;
To solve this issue, I find that we can modify the logic in the
session_impl:reopen_listen_sockets
function to let it push two endpoints v4.any() and v6.any() instead of only v4.any() into eps like this wayI'm not sure if this modification has any unexpected side effects but this recompiled version works pretty well on my machine so far.
The text was updated successfully, but these errors were encountered: