When I debug my project the browser show "SPA proxy launch page" with port 7253 the redirect to my application with port 44483.
However, I have noticed that the SignalR Hub is running on port 7253 instead of 44483. I found this problem once I tested with Postman. It return 404 for port 44483 while it work with port 7253.
I'm a bit confuse because my swagger page is working well which is running on port 44483.
Anyone have idea on what is going on?
I refer to this tutorial https://learn.microsoft.com/en-us/aspnet/core/tutorials/signalr-typescript-webpack?view=aspnetcore-6.0&tabs=visual-studio
Related
I made an Api using Asp.Net and lauched it on my Ubuntu VPS. I can access it locally using localhost, but when i try to access it using ip, i get the connection refused error. I tried setting up nginx, now it redirects from port 80 to port 5000, but i still get the connection refused error. Why is my Api not accessible remotely from the Internet? I spent a whole working day trying to solve this, and I am desperate at this point.
Here is the link to my question about nginx: Asp.Net + Nginx. Works if using localhost, but fails if using ip
Solved: I needed to use the command line argument --urls http://*:5000
I'm running VS2019 community, and I've created the default ASP.NET Core Web API project (ASP.NET Core 5.0), the one with the simple weather forecast example. And I am now trying to connect another computer to the URL. I run the example by using the [application name] in the run dropdown, and not IIS Express.
Both computers are connected via wifi to the same Router.
I do an ipconfig on the server machine to get it's IP (192.168.1.108)
And I have also enabled inbound connections from the ports 5000-5001 in the windows firewall setup
On the "client" machine I try to access the server with :
http://192.168.1.108:5000/swagger/index.html
or
https://192.168.1.108:5001/swagger/index.html
but neither seem to work? The page ends up timing out.
So on the machine running the server, I also completely disabled the windows firewalls (temporally, just to get things working).
But still get the same result?
Have I missed a step?
Maybe this will help you. Try to add IP of your host into Program.cs
var host = new WebHostBuilder().UseUrls("http://192.168.1.108:5000")
I am trying to connect my Xamarin.Forms mobile application to a RESTful API I'm hosting locally on my computer. I'm using Visual Studio for both the Xamarin.Forms mobile application and for the API, and for the API, I'm using ASP.NET Core (the specific template in Visual Studio is ASP.NET Core Web Application (.NET Framework) ).
It worked fine when I connected to it from my browser using a localhost address on the same computer I ran the API from (in my case, localhost:59475/api/ was the URL) and before connecting my mobile application to the API, I first tried to connect to the API from other computers on the same network, and I didn't manage to make it work so far. What I tried so far is the following - run the cmd command netsh http add urlacl url=http://*:59475/ user=everyone (along with other similar commands with other ports I thought may work), then I added an inbound firewall rule to allow all connections on that port. I then tried to connect to the API from other computers on the network by replacing "localhost" in the address with the IP of the computer running the API, and I received an HTTP 503 error when I did. Evantually what happend is when I tried to run the API from Visual Studio it showed an error of
Unable to connect to web server 'IIS Express'
"Undoing" the netsh http commands (netsh http delete urlacl...) made it work again as it did at first (again, only able to connect to it from the same computer using my browser). I don't know how to make it work and would like to receive help please! :)
Try the following:
add your external IP explicitly netsh http add urlacl url=http://192.168.0.6:60985/ user=everyone
In the root of the API solution folder open the '.vs/config/applicationhost.config' file (.vs is hidden by default)
in the bindings section add a new binding to the external address <binding protocol="http" bindingInformation="*:60985:192.168.0.6" />, mind to which site you are adding the bindings as there could be multiple.
Notes: example port 60985 yours could be different check the api
example IP: 192.168.0.6, change to your actual external IP address
You might want to disable the firewall for testing then when you confirm it works, enable it and add an exception rule
I had the same problem.
I solved with the magical Conveyor extension.
https://keyoti.com/products/conveyor/index.html?utm_source=conveyor&utm_medium=extension_moreinfo&utm_campaign=conveyor
Follow the guide on their website.
In netcore, disable SSL first (project property => debug)
I'm following the sample application of a Webserver, handling incoming requests through TCP with a Port.
Sample application with code: https://incredibits.io/project/windows-10-iot-internet-of-things-tips/windows-10-iot-raspberry-pi-web-server
When debugging the UWP application on my Windows 10 machine, and try to access the the local IP (192.168.x.x <- Ofcourse I've entered my actual local IP) I get what I'm supposed to. The application get's an incoming request and returns some data back to me (The client) on another computer of mine.
The issues I'm facing is when I deploy this to my Raspberry Pi 3 running Windows 10 IoT Core (The newest from Insider), I can't access the application from my client computer at all. Is this a thing with the Pi's firewall or something else preventing this?
I CAN access the IoT Core's Web interface on port 8080, but I cannot access my application running on port 80. (I've tried switching the port to another one aswell, works locally on my Windows 10 but not on the Pi)
Does anyone know a solution, or have faced a similar issue?
Note:
I've also tried examples like (https://ms-iot.github.io/content/en-US/win10/samples/BlinkyWebServer.htm) which again, works on my Windows 10 pc, and can be accessed by my other PC if their on the same network, but not on my Pi)
I found the solution to my problem.
The port I was using, wasn't opened up in the Raspberry Pi's Firewall. I couldn't find how to add a rule to the Firewall but after some help on Freenode C# Chat forum, I found the following snippet:
First I log into the Pi through PowerShell
Enter-PsSession -ComputerName MyRaspberryPi-Credential MyRaspberryPi\Administrator
Then I manually add the Firewall opening of the port I'm using. In this case port 8080.
netsh advfirewall firewall add rule name="Raspberry Pi Webserver" dir=in action=allow protocol=TCP localport=8080
After that, everything worked as expected. I could access the port on my Raspberry Pi! All good!
Thanks to #canton7 and #taylor-kidd in the comments, for coming with suggestions that in the end helped me!
EDIT 12th of April:
It seems like this issue with the Firewall not being opened, was actually a known issue by Microsoft already. They write that in their Relase notes for the Insider Preview version 14295 (Which I am using) here http://ms-iot.github.io/content/en-US/win10/ReleaseNotesInsiderPreview.htm
I am using a 3rd-party tool that runs as a Microsoft Service on a Windows Server 2008 R2 machine. The machine is using a Dell SonicWall firewall. The tool has defined ports that it is listening on of which I have opened one. Using an external web tool that port is listed as open. The service has been installed and shows as running when I run services.msc.
Everything runs great on my local machine. However, when I try to query the service I get a 403 error. The following is what the query URL looks like:
https://{siteUrl}:{portNumber}/scanservice/v2/getstatus?method=jQuery111106758983342442662_1428439579840&_=1428439579841
This is an AJAX GET request coming from an ASP.NET MVC application.
The code attempts to find an open port by querying 3 ports that are the https ports for the service. The first two are ports that I have not opened on the machine. These queries time out which is what I would expect. The last port is the one I have opened on the server. I immediately get a 403 error.
Is there somewhere where I need to expressly allow that service, not just the port?
It is a case where your public IP is not whitelisted on the web service hosting server