(Copy pasted this from stack overflow, got no answer there.)
I just got started with Blazor, following [Microsoft's Guide,][1] but I need to allow outside access from http, so I can access it from ```<server-ip>:5000```, as I am running a linux VPS that I don't have GUI access to. Is there any way to do this? (When
creating my Blazor app, I left out the ```--no-https```) Sorry if this is a dumb question. [I looked it up on google][2] and found nothing helpful to me.
I get this:
[![This is the error][3]][3]
When I run ```dotnet run```
If you're wondering which version of Blazor I'm running (WASM or Server), I don't know. I'm just following Microsoft's guide.
Generally neither port 5000 or the ssl 5001 port are open to external browsers. You will need to open the firewall. See your Linux docs for this. Remove the httpsrediect option in startup if you don’t want ssl redirection forced.
Member
1 Points
3 Posts
Is there a way to make blazor allow outside http access?
Jan 14, 2021 09:26 PM|Lit|LINK
(Copy pasted this from stack overflow, got no answer there.)
I just got started with Blazor, following [Microsoft's Guide,][1] but I need to allow outside access from http, so I can access it from ```<server-ip>:5000```, as I am running a linux VPS that I don't have GUI access to. Is there any way to do this? (When creating my Blazor app, I left out the ```--no-https```) Sorry if this is a dumb question. [I looked it up on google][2] and found nothing helpful to me.
I get this:
[![This is the error][3]][3]
When I run ```dotnet run```
If you're wondering which version of Blazor I'm running (WASM or Server), I don't know. I'm just following Microsoft's guide.
[1]: https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/run
[2]: https://www.google.com/search?q=how%20to%20allow%20outside%20blazor%20access&oq=how%20to%20allow%20outside%20blazor%20access&aqs=chrome..69i64j69i57.2200j0j9&sourceid=chrome&ie=UTF-8&safe=active
[3]: https://i.stack.imgur.com/xAgUw.png
All-Star
58174 Points
15655 Posts
Re: Is there a way to make blazor allow outside http access?
Jan 14, 2021 10:41 PM|bruce (sqlwork.com)|LINK
Generally neither port 5000 or the ssl 5001 port are open to external browsers. You will need to open the firewall. See your Linux docs for this. Remove the httpsrediect option in startup if you don’t want ssl redirection forced.
Member
1 Points
3 Posts
Re: Is there a way to make blazor allow outside http access?
Jan 15, 2021 01:30 AM|Lit|LINK
Can I change the port to something like 8080 or 8000?
All-Star
58174 Points
15655 Posts
Re: Is there a way to make blazor allow outside http access?
Jan 15, 2021 03:40 PM|bruce (sqlwork.com)|LINK
Yes. You can set it in appsettings.json or the command line. It all depends on how you are launching the app.
Member
1 Points
3 Posts
Re: Is there a way to make blazor allow outside http access?
Jan 15, 2021 05:48 PM|Lit|LINK
How would I do it from appsettings.json? I opened it in nano, and this is what I got. Nothing about the port:
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
thanks for helping me with my newbie questions
All-Star
58174 Points
15655 Posts
Re: Is there a way to make blazor allow outside http access?
Jan 15, 2021 08:57 PM|bruce (sqlwork.com)|LINK