IISExpress configuration allows external access details
1. Find the configuration file of IISExpress, located in the <Document>/IISExpress/config folder, open applicationhost.config, and find the following code:
<site name="WebSite1" id="1" serverAutoStart="true"> <application path="/"> <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%/WebSite1" /> </application> <bindings> <binding protocol="http" bindingInformation=":8080:localhost" /> </bindings> </site>
Where name is the name of your web project, find the configuration corresponding to your project, and then
<binding protocol="http" bindingInformation="*:8080:localhost" />
Added later
<binding protocol="http" bindingInformation="*:8080:192.168.1.1" />
Among them, 192.168.1.1 is changed to your own IP address, and 8080 is changed to your own port.
2. After clicking the above to change it, when you access it through the IP address, you may experience 400 errors. If it occurs, use the following method:
(1) Open the CMD command window as an administrator (2) Enter the following command:
netsh http add urlacl url=http://192.168.1.1:8080/ user=everyone
Similarly, change the IP address and port to your own. If an error is reported, please confirm whether it is a CMD running as an administrator. Restart IISExpress, you should be able to access it using the IP address.
3..After completing the above two parts, due to the firewall, other computers may not be able to access your server. If this happens, use the following method (the system here is win8.1)
(1) Control panel (check method to select category) -> System and Security -> Windows Firewall, select Advanced Settings on the left (2) Right-click the inbound rule -> New rule -> Port -> Enter 8080 at a specific local port -> Allow connections -> 3 options to select all -> Enter new rule name -> Complete
Now external programs can access your IISExpress
Thank you for reading, I hope it can help you. Thank you for your support for this site!