Network Connectivity Improvements (Add Announce Port Override And ipv4-only Mode)#531
Merged
ikatson merged 8 commits intoikatson:mainfrom Jan 17, 2026
Merged
Conversation
feat: make peer limit configurable per torrent
Owner
|
Hi, thanks a lot for this PR, looks great, and all the features are welcome! I'd merge right away just please fix cargo fmt |
Contributor
Author
|
Sweet! Should be formatted and up to date with main. If there is anything else needed to merge, just let me know. Thanks! |
Contributor
Author
|
Tests should pass now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think this project is fantastic! To optimize my own experience, I implemented these changes in my fork, but I believe others could benefit from them as well (and quite frankly, I'd love to avoid maintaining a permanent fork 😅).
This PR addresses connectivity issues encountered when running rqbit behind certain VPN providers (in my case ProtonVPN on macOS) and in environments lacking IPv6 support.
1. Announce Port Override: (Most Important to me)
Many VPN services, including ProtonVPN, assign an external port for port forwarding that differs from the internal listening port. For example, rqbit might bind locally to port 4240, but the VPN provider forwards external traffic from port 55555 to 4240. Without the ability to manually specify the announce port, rqbit advertises its local port (4240) to trackers and the DHT. External peers attempt to connect to that port and fail because the VPN is only forwarding traffic on the assigned external port (55555).
2. IPv4-Only Mode (Moderately important to me)
Some network configurations, including the ProtonVPN GUI client (at least on macOS), often lack full IPv6 support or have inconsistent IPv6 connectivity. In these cases:
3. Port 0 Filtering (Least Important to me)
Added explicit filtering to reject peers advertising port 0, which is technically invalid and often indicative of "junk" data or bad NAT mappings, further improving connection stability.
Changes