简体   繁体   中英

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.

I have tried all the steps here (where tower is my hostame) but it's not working:

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条目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM