问题描述
我想连接到与同一网络中的另一台PC主机就可以了ASP.NET应用5我的红隼服务器。可能吗?我可以从CMD ping通我的电脑,但我得到'连接超时当我尝试从Web浏览器连接(我输入:HTTP:// {} my_kestrel_ip:5000 /)。
I would like to connect to my Kestrel server with ASP.NET 5 application hosted on it from another PC in the same network. Is it possible? I can ping my computer from cmd, but I get 'Connection timed out' when I try to connect from a web browser (I type this: "http://{my_kestrel_ip}:5000/").
推荐答案
在项目文件夹,你应该有一个名为 hosting.ini
。在默认情况下这个文件,你应该有这样的事情:
In your project folder you should have a file called hosting.ini
. In that file by default you should have something like this:
server=Kestrel
server.urls=http://localhost:5000
您必须对您的公共IP地址的HTTP服务器监听以及本地主机。要做到这一点,你可以通过用分号分隔添加额外的地址:
You need to make the HTTP server listen on your public IP address as well as localhost. To do that, you can add an additional address by separating them with a semi colon:
server.urls=http://localhost:5000;http://{my_kestrel_ip}:5000
这篇关于ASP.NET 5隼局域网内连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!