Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Alternatively, you can use something like <a href="http://www.analogx.com/contents/download/Network/pmapper/Freeware.htm" rel="nofollow noreferrer">AnalogX's PortMapper</a> to act as a small loopback proxy to <em>tunnel</em> privately localhost bound ports to publicly open ports.</p> <p>For example,</p> <ul> <li><strong>IISExpress</strong> is locally bound to <strong>localhost:8080</strong></li> <li><strong>PortMapper</strong> port <strong>9090</strong> is configured to relay traffic to <strong>localhost:8080</strong></li> </ul> <p>Effectively, any connection on port <strong>9090</strong> (opened by <strong>PortMapper</strong>) will be tunneled to <strong>localhost:8080</strong>; thereby bypassing all the netsh nonsense which can be a pain sometimes.</p> <p>Below is my configuration:</p> <p><img src="https://i.stack.imgur.com/FYVSe.png" alt="PortMapper configuration"></p> <p>The benefit of using this proxying method is that it does not permanently expose an open <strong>IISExpress</strong> port on the local dev box.</p> <p>Rarely, there are times when I want to open the port publicly for meetings; but most of the time, the port should closed and only be accessible by localhost. Modifying firewall rules on the router every time is a pain. Here's how I have things setup:</p> <ul> <li>My router firewall forwards <strong>9090</strong> port to <strong>PortMapper</strong></li> <li><strong>PortMapper</strong> only continues proxying the traffic to <strong>IISExpress</strong> (listening on <strong>8080</strong>) only if <strong>PortMapper</strong> is running.</li> </ul> <h3>Note</h3> <p>Make sure to close out all the <strong>PortMapper</strong> windows for any changes to take effect.</p> <h3>Note 2</h3> <p>As others have described, you might need to adjust the <strong>IISExpress</strong> bindings for your application in</p> <pre><code> My Documents\IISExpress\applicationhost.config project\.vs\config\applicationhost.config </code></pre> <p>to something like:</p> <pre><code>&lt;bindings&gt; &lt;!-- bindingInformaiton format: IPToBindTo:Port:DNSHostName --&gt; &lt;!--OLD: &lt;binding protocol="http" bindingInformation="*:8080:localhost"/&gt;--&gt; &lt;!--Change '*' to 127.0.0.1 and remove 'localhost' right of the port number to avoid invalid DNS hostname errors --&gt; &lt;binding protocol="http" bindingInformation="127.0.0.1:8080:" /&gt; &lt;/bindings&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload