Accessing an IIS Express Site From an iPad

We often develop websites that require specific styling to render properly on the iPad via Safari. By default, sites served from one’s development machine are not accessible by other machines. So how does one go about allowing your iPad to access your website running within your local development environment? While not entirely straightforward, it’s actually a fairly simple process.

Step One: Ensure that you are using IIS Express.

  1. Right-click on the web project within Visual Studio 2012’s Solution Explorer and choose “Properties”.
  2. On the “Web” tab, choose “Use Local IIS Web Server” under the “Servers” section.
    • The Project URL should be something like: http://localhost:55611/ Notice that we have specified a particular port. Let’s assume 55611 for the remainder of this post.

Step Two: Set up IIS Express to allow remote connections to the site.

  1. This is done by adding an additional binding to the IIS Express applicationhost.config file. On Windows 8, this file is located at the following path: C:\Users\[Your Name]\My Documents\IISExpress\config\applicationhost.config
  2. Open this file and locate the line for the site that corresponds to the port that you have previously setup for your project. It will look something like this:
    <binding protocol="http" bindingInformation="*:55611:localhost" />
  3. Add an additional binding to allow connections to this port from any other machine:
    <binding protocol="http" bindingInformation="*:55611:*" />
  4. Be sure to restart IIS Express in order for the changes to be enabled.

Step Three: Configure HTTP.SYS at the kernel level to allow incoming connections from outside your computer.

  • From a command prompt with administrative rights:
    netsh http add urlacl url=http://*:55611/ user=Everyone

Step Four: Configure the Windows firewall to allow incoming connections.

  • From a command prompt with administrative rights:
    netsh advfirewall firewall add rule name=”IISExpressWeb” dir=in protocol=tcp localport=55611 profile=private remoteip=localsubnet action=allow

Step Five: Verify that it works.

  1. Ensure that your development machine and the iPad are connected to the same wireless network.
  2. Determine your development machine’s IP address.
    • From a command prompt with administrative rights: ipconfig
    • Look for the adapter that corresponds to the wifi network that the iPad is on.
    • Your development machine’s IP address is listed as “IPv4 Address.”
  3. Open Safari on the iPad and type the following address: http://DEV-IP:55611/, where “DEV-IP” is the IP of your development machine.

References:
Working with SSL at Development Time is easier with IISExpress
Using IIS Express to host a website (temporarily)

Special thanks to Eric Honour for reviewing this content.

About Ben Brouse

Ben Brouse is an AIS Solutions Architect and responsible for the execution of creating business solutions using .NET technologies. Ben brings over 18 years of experience and leadership to his position and has been at AIS for 12 years. Ben has participated in both shrink-wrap custom software and custom solutions. His expertise spans both rich-client thick applications and also highly distributed fault-tolerant applications in mission critical applications. Most recently, Ben has been focused on building distributed systems for a broad spectrum of devices in conjunction with cloud platforms. Ben is a MCP and serves in an architectural capacity within AIS.

  • Blowsie

    This didn’t work for me, I got the following message.

    Service Unavailable
    HTTP Error 503. The service is unavailable.

    Any Ideas?

    • Balassa Márton

      same here with VS2012 and IIS 8.0 🙁

    • Perry

      I had this issue also. Make sure you are not just changing the bindingInformation, but instead creating a new binding element. Check the rest of the file, VS might have created a new entry like YourAppName(1).

      Lastly run VS as administrator in order to bind to your NIC IP address.

  • Andre

    Awesome Article! Thanks so much!

  • Tom Wilson

    This worked for me, thanks! I’m also connecting to an android device and this helped make it work there..

    https://developers.google.com/chrome-developer-tools/docs/remote-debugging#reverse-port-forwarding

  • Michael

    This worked perfectly – thank you!

  • Abey Thomas Raju

    Haa I was looking for this help and this article did just what I wanted (except I was using normal IIS) – it worked like a charm!

  • Jahwik

    Would this also work for requests coming from out of the internal network?
    Thanks

  • Ionut-Cristian Florescu

    I remember running into problems while trying this workflow a few months ago.

    Which is why I wrote a simple proxy utility specifically for this kind of scenario: https://github.com/icflorescu/iisexpress-proxy.

    Using the IIS Express Proxy, it all becomes quite simple – no need to “netsh http add urlacl url=*:55611/ user=everyone” or to mess up with your “applicationhost.config”.

    Just issue this in command prompt:

    iisexpress-proxy 55611 to 3000

    …and then you can point your remote devices to http://DEV-IP:3000.

    Most of the times simpler IS better.