Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

Is there a way to make Blazor allow outside http access?

I just got started with Blazor, following Microsoft's Guide, 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 and found nothing helpful to me.
I get this: This is the error 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You'll have to set up the server to listen to other ip addresses than localhost (127.0.0.1). You can either give it a specific address or get it to listen to everything:

export ASPNETCORE_URLS="http://+:5000"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...