Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUPnP and NAT-PMP port forwarding #195
Comments
This comment has been minimized.
This comment has been minimized.
|
Second this, I'm trying to make connections and it simply won't work .. |
This comment has been minimized.
This comment has been minimized.
|
@jman6495 In node, right? Making outgoing connections doesn't need an open port or even a listening socket. |
This comment has been minimized.
This comment has been minimized.
|
@jman6495 Yeah, you should be able to download just fine without UPnP and NAT-PMP port forwarding. They're just useful if you want people to be able to make incoming connections to you. |
This comment has been minimized.
This comment has been minimized.
|
Any progress on this? |
This comment has been minimized.
This comment has been minimized.
|
There is a nice library that I use in my own projects, node-nat-upnp but it needs a couple of small fixes |
This comment has been minimized.
This comment has been minimized.
|
Leaving this here for future reference RFC5128: State of Peer-to-Peer (P2P) Communication across Network Address Translators (NATs) |
This comment has been minimized.
This comment has been minimized.
|
Any update on this issue? |
This comment has been minimized.
This comment has been minimized.
|
@roccomuso Yeah, and someone needs to do the work of integrating it. |
This comment has been minimized.
This comment has been minimized.
|
@feross any idea on the upnp module to use? |
This comment has been minimized.
This comment has been minimized.
|
No, sorry. I haven't done an exhaustive search of npm. Ideally, something with no or few dependencies. And definitely no native dependencies. |
This comment has been minimized.
This comment has been minimized.
|
Ok, there's no wide choice around, I came out with this, https://github.com/indutny/node-nat-upnp |
This comment has been minimized.
This comment has been minimized.
|
@roccomuso That looks fine, but the dependencies are a bit heavyweight. For NAT-PMP, this module looks excellent: https://github.com/TooTallNate/node-nat-pmp -- only has |
This comment has been minimized.
This comment has been minimized.
|
@feross So what should be the general workflow? Trying first to use NAT-PMP and if failed then having a fallback on UPNP? |
This comment has been minimized.
This comment has been minimized.
|
Basically, upon initialization of a WebTorrent client, we should create a port mapping using the client's listening post ( You can probably just add a new function to |
This comment has been minimized.
This comment has been minimized.
|
Watch out there is a small bug in node-nat-upnp I made an attempt to solve it at one point in indutny/node-nat-upnp#20 which was good enough for a use case I had, but it might be better to have a look at storj/core#78 for a complete fix. It would be great to get the bug fix into upstream and have updated version of the npm module published. |
This comment has been minimized.
This comment has been minimized.
|
@mnaamani We will start with UPnP first and use NAT-PMP as fallback. Just in case NAT-PMP is not as stable as UPnP. After a few month and user feedback we can think about a different order. We had a few problems with UPnP. |
This comment has been minimized.
This comment has been minimized.
|
@feross without this, none of the webtorrent-desktop clients are talking to each other, right (unless you specifically open your webtorrent port on your router)? This seems like a pretty big deal, at least in terms of healthy network topologies, since webtorrent-desktop is gaining some traction. |
This comment has been minimized.
This comment has been minimized.
|
@lmatteis webtorrent-desktop clients that are not behind NATs can be reached by all other clients (webtorrent-desktop and otherwise). But yeah, you're right. |
This comment has been minimized.
This comment has been minimized.
|
@feross hope we can soon see more of the https://github.com/indutny/node-nat-upnp and https://github.com/TooTallNate/node-nat-pmp integration soon, as WebRTC is not running really well with many torrents #903 |
This comment has been minimized.
This comment has been minimized.
|
I just discovered this https://github.com/bcoin-org/bupnp |
This comment has been minimized.
This comment has been minimized.
|
Is there anyone who still keeps track of this issue? |
This comment has been minimized.
This comment has been minimized.
|
#1437 actually worked and I used it. It was closed because no one reviewed it. |
This comment has been minimized.
This comment has been minimized.
I reopened it. We're behind on code reviews but I'm trying to work my way through them slowly. Thanks for understanding! |
Note: UPnP only makes sense in the node.js (server) use case. In the browser, WebTorrent uses WebRTC and the browser handles NAT traversal using the ICE, STUN, and TURN protocols. Lots of fun acronyms :)
This issue is for adding UPnP and/or NAT-PMP support to WebTorrent. There appear to be quite a few implementations on npm, so a bit of research will be required to find the best implementation to use.