libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Add support for overriding the NAT-PMP gateway

Open farcaller opened this issue 1 year ago • 2 comments

libtorrent version (or branch): 1.2.19

platform/architecture: linux x86_64

compiler and compiler version: n/a

please describe what symptom you see, what you would expect to see instead and how to reproduce it.

libtorrent always tries to resolve the default gateway via the routes available. If the nat-pmp provider isn't actually the direct gateway (in e.g. a containerized environment), then the port mapping fails.

I suggest to add a setting that allows a client to override the gateway. In fact, I made a test implementation of this (https://github.com/farcaller/libtorrent/tree/natpmp) and verified it working with a patched qBitTorrent version. I'm just not sure how to make a proper PR for this, as qBitTorrent doesn't seem to be ready for 2.0 yet and thus I wrote the diff against 1.2.19.

farcaller avatar May 31 '24 18:05 farcaller

Thank you very much @farcaller, I needed this.

I've made a commit that syncs with the latest commit on RC_2_0. Maybe this can become a pull request? @arvidn would you accept a PR?

samvv avatar Feb 24 '25 00:02 samvv

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.

stale[bot] avatar Jul 19 '25 05:07 stale[bot]