libtorrent
libtorrent copied to clipboard
Make proxy_peer_connections and proxy_tracker_connections settings independent
Please provide the following information
libtorrent version (or branch): master
platform/architecture: linux
compiler and compiler version: gcc-9
Some trackers are udp only but the available proxy does not support udp connections. I would like to make tcp peer connections with proxy and use direct connection to connect to udp tracker.
If proxy_peer_connections
and proxy_tracker_connections
could be enabled independently, then it would be possible to connect to udp trackers with a direct connection and use tcp peer connections with the available proxy.
The goal is to have the following two independent settings in torrent client:
- Force communication with peers over proxy
- Force communication with trackers over proxy, including DHT.
If proxy_peer_connections and proxy_tracker_connections could be enabled independently, then it would be possible to connect to udp trackers with a direct connection and use tcp peer connections with the available proxy.
What do you do when you receive a direct incoming peer connection? It sounds like you want a mode where you just ask for peers from the tracker, without it recording your IP and port in its peer list
A mode where the direct vpn connection handles the udp tracker because it can support udp connections and the other proxy handling the peer connection with tcp only.
the case I was getting at is that when you contact a tracker, it will look at the source IP (and port in the case of DHT) and assume that's how one can reach your peer. That source IP and port will be handed out to other peers.
It doesn't really matter whether you use some other proxy for making outgoing connections to peers, incoming connections will be made based on the source IP of your tracker announce.
so, if you don't use a proxy for the tracker announce, other peers will connect to you directly. They don't know anything about your proxy for peer connections.
Another aspect of this is UPnP and NAT-PMP (/PCP). If you have some specific plan to announce your public IP but not accept incoming connections over it, the port forwarding would also need an independent configuration. But I suppose you could just disable port forwarding.
However, if you have a full-cone NAT, the fact that you announced to the tracker may have opened a pin-hole allowing peers to connect to you anyway. At least over uTP (since that's UDP).
A way to keep the vpn from knowing what the peer connections are doing over a proxy.
The only torrent client available that has the ability to independently control the tracker and peer connection proxy settings is tTorrent on Android. I can verify that it works as expected. It would be really great if this library could also support that functionality for a Linux solution.
the first step is to define, precisely, how it's expected to work.
Yes! Thank you, Syphyr, for mentioning this tTorrent app. Just checked and it has EXACTLY the behavior I need, when you can connect to trackers directly and to peers via proxy! To bad it's only for Android :(