[英]Access WebAPI running on IISExpress over local network
I'm running a WebAPI project locally which I would like to access from a mobile device connected on the same network. 我正在本地运行一个WebAPI项目,我想从连接在同一网络上的移动设备进行访问。
I have tried all the steps here (where tower
is my hostame) but it's not working: 我已经尝试了所有的步骤, 在这里 (其中tower
是我hostame),但它不工作:
There are three changes you might need to make.
Tell IIS Express itself to bind to all ip addresses and hostnames. In your .config file. Typically:
VS 2015: $(solutionDir)\.vs\config\applicationhost.config
Find your site's binding element, and add
<binding protocol="http" bindingInformation="*:8080:tower" />
Setup the bit of Windows called 'http.sys'. As an administrator, run the command:
netsh http add urlacl url=http://tower:8080/ user=everyone
Allow IIS Express through Windows firewall.
Start / Windows Firewall with Advanced Security / Inbound Rules / New Rule...
Program %ProgramFiles%\IIS Express\iisexpress.exe
OR Port 8080 TCP
Locally everything is working fine: 在本地,一切工作正常:
However on mobile - I am getting an error: 但是在移动设备上-我收到一个错误消息:
tower's server DNS address could not be found.
ERR_NAME_NOT_RESOLVED
Does anybody know why this might be happening - have I missed something obvious? 有谁知道为什么会这样-我错过了明显的事情吗?
这很可能意味着“塔”没有DNS对应关系,因此您需要使用IP地址或添加正确的DNS条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.