1 Commits
Author SHA1 Message Date
ManakandGitHub 75af643083 fix: disable NAT-PMP on macOS to prevent EADDRINUSE crash on port 5350 (#45)
macOS mDNSResponder permanently occupies UDP port 5350, which is the
NAT-PMP client port that webtorrent binds when initializing its NAT
traversal. The bind fails asynchronously with EADDRINUSE, and since
the PMP client is a raw EventEmitter with no error listener, it
surfaces as an uncaughtException that kills the app the moment a
download starts.

NAT-PMP can never succeed on macOS because the port is permanently
taken, so disable it on darwin only and let UPnP handle NAT traversal
instead. Other platforms are unaffected.

Closes #22
2026-07-05 09:59:53 -04:00