Open jyang opened 6 years ago
I see the issue being listening on a port that is already open.
BTW, node-udp-hole-punching works for the same hosts and networks that I tested here.
I see the issue being listening on a port that is already open.
BTW, node-udp-hole-punching works for the same hosts and networks that I tested here.
https://pdos.csail.mit.edu/papers/p2pnat.pdf Check out section 4.1, it looks like there's a potential workaround.
I have the same issue, both client a and b are on different nat's, and they both throw EADDRINUSE when I run B
TCP hole punching doesn't always work. It depends on the underlying operating system.
then how do torrenting or other p2p technologies work with people under nat's? I can download a torrent, let's say linux iso's with this exact setup and also seed them but this demo does not work for some reason
then how do torrenting or other p2p technologies work with people under nat's? I can download a torrent, let's say linux iso's with this exact setup and also seed them but this demo does not work for some reason
They use a combination of TCP (where possible), error-tolerant UDP hole punching and also uPnP where available. Most routers seem to come with uPnP enabled by default so it's worth considering that feature for the app that you are working on.
The availability of TCP/UDP hole punching seems to also depend on the type of NAT that you are behind, if you are working with JavaScript then the package that I worked on (npm link at bottom) might help determine the possibile options, i.e. you can have difficulties with different kind of NATs especially 4G and business networks which mess up UDP hole punching with symmetric NATs.
library: https://www.npmjs.com/package/nat-type-identifier. further reading: https://www.researchgate.net/publication/228411948_A_New_Method_for_Symmetric_NAT_Traversal_in_UDP_and_TCP
First, thank you for this little sample! It's so exciting to get it to work with minimal dependencies.
My issue looks different than the other two already filed. My public server runs on a host with a public IP. My client A and client B run behind their own NAT. Both of them are on Linux. I have this issue on Ubuntu 18.04 and Debian Stretch. Node version is 8.9.4 or 6.14.2.
Apparently, this line failed: