-
Notifications
You must be signed in to change notification settings - Fork 97
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
Open.NAT and ASP.NET #97
Comments
You are not providing anything that can help me to help you. Could you post the Open.NAT log file? I would also suggest to map using the same port with a higher port, for example: await device.CreatePortMapAsync(new Mapping(Protocol.Tcp, 15_000, 15_000, "Test")); Once you have this just listen in that port with $ nc -l 15000 and then hit that endpoint from outside of your LAN (using your cellphone data plan, for example) and check if it was reached. |
Thanks for your fast reply! Where can I find the Open.NAT log file? |
You have to enable the logging. https://github.com/lontivero/Open.NAT/wiki/Troubleshooting |
I have followed your advice and changed the mapping entry to await device.CreatePortMapAsync(new Mapping(Protocol.Tcp, 15000, 15000, "Test")); I also enabled logging. The generated log contains the following:
(note: the last lines of logging are generated by my ASP.NET application) I then used the |
Open.NAT opened the port successfully. You have verified that fact when after using https://canyouseeme.org/ you saw some output in the I think you are probably making a mistake in your ASP application. Make sure to listen in the correct port and with the correct prefixes. It is a common mistake to listen on 127.0.0.1 instead of something more generic like http://+:15000 Anyway, there is nothing else I can help you here because clearly the port is opened. |
Ok, no problem, thanks for your time and help. |
The problem
I am writing a small web service application using ASP.NET. I want this web API to be visible from outside a home network (behind NAT). The problem is that the user I'm writing this program for, has no access to change his router. Creating a portforwarding rule in the router configuration is no option.
As a solution to this, I tried to use UPNP with the Open.NAT framework. Sadly I can't get this to work. I'm able to create a rule, I can see that the port is open using online tools such as canyouseeme but I cannot connect to the web api using a browser. I am 100% sure UPNP is enabled on my router.
Code
The code I'm currently using is the default weather forecast code that is generated by visual studio when creating a ASP.NET web API. I added Open.NAT from the NuGet package manager.
Then I changed the default code to the following
When I run this application and go to canyouseeme, I get the information as shown in this image but I cannot connect to the web api using the browser. (Also tried to connect using cURL without result)
Additional things I did
In order to try to solve this, I also did the following:
I really hope I can find a solution. Thanks for taking time to read my question.
Link to stackoverflow post I made
https://stackoverflow.com/questions/62038952/how-to-use-open-nat-in-an-asp-net-web-api
The text was updated successfully, but these errors were encountered: