Welcome to OGeek Q&A 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 Reply

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"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...