-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual TCP/UDP port mapping does not work as expected #4
Comments
Hi @TheBrainEscaped, Super thank you for the feedback ❤️ I haven't yet be able to reproduce the bug. However, it looks like the problem is related to PMP. So I have added an option on the last version ( Please check it out and let me know how it went :) |
I can confirm that with Thanks for the update! |
Let me take that back. I distinctively remember creating a quick test project on Windows 10 and testing some of the above code against 0.1.3 and had my ports appearing on the router's "UPNP "page without issues. However, testing on a Linux distribution I started running into issues again so I decided to re-test on Windows and managed to replicate the issues encountered on Linux. This code
leads to
and no ports mapped. I have come to realize that my router only supports NAT-PMP, therefore the exceptions above are unavoidable due to nat-api attemtping UPNP mapping by default. To test this assumption, I went ahead and commented out all UPNP related code and re-tested with
The above maps both ports, however it bombs with
The culprit, line 257 in lib/pmp/index.js : Would it be possible to have the option to toggle the mapping type between UPNP and NAT-PMP ? Something along the lines of:
And of course if |
nat-api version: 0.1.2
Test 1:
Maps port 10000 UDP and bombs for TCP with:
Test 2 (with NULL protocol in options):
Maps port 10000 UDP and bombs for TCP with:
Test 3:
Works:
Port mapped!
Test 4:
Works:
Port mapped!
Test 5:
TCP port mapped, UDP port bombs:
Test 6:
UDP port maps, TCP port bombs:
Conclusion: dual TCP/UDP port mapping does not work as expected.
The text was updated successfully, but these errors were encountered: