feat(stream): add NAT-PMP port mapping for remote downloads

Replace anacrolix/upnp with huin/goupnp + custom NAT-PMP (RFC 6886)
implementation. NAT-PMP is tried first (faster, more compatible with
TP-Link routers), with UPnP-IGD SOAP as fallback. Gateway detection
reads /proc/net/route for accuracy. Includes unit tests with mock
NAT-PMP server and permanent e2e tests (build tag manual).
This commit is contained in:
Deivid Soto 2026-04-06 10:09:07 +02:00
parent 819c727bf5
commit aa6acbabc9
8 changed files with 1030 additions and 24 deletions

View file

@ -104,6 +104,7 @@ func TestStreamServerRangeTracking(t *testing.T) {
}
srv := NewStreamServerFromDisk(tmpFile, 0)
srv.disableUPnP = true
ctx := context.Background()
url, err := srv.Start(ctx)
if err != nil {