So before I start, I know how to open up IISExpress to the network, there's plenty of articles about this, I even wrote one. However, these approaches do have limitations - most notably the need to add bindings which I've found to be hit-or-miss and worse, breaks any code that does things based on hostname.
I am on OsX running Windows 10 inside of Parallels and earlier this week I thought I should try to get localhost forwarded into the VM in the same way that I can do with docker containers.
I got really close, but I cannot figure out the last step. Here is what I did and what I am seeing:
- I temporarily disabled my firewall on Windows
- I forwarded the correct port (44300 in this case) to the guest VM and rebooted it.
- I ran iisexpress through the command line so that I can see the full log (I tried through visual studio as well)
What I'm seeing is that when I hit localhost:44300
from inside the VM, my site loads fine and all sorts of things are logged.
But when I hit it from the host I'm getting
HTTP Error 403. The request URL is forbidden.
There is nothing logged by iisexpress in this scenario.
However, I know that the request is in some manner getting through since if I stop iisexpress and head to localhost:44300
again on the host, I get the standard
localhost refused to connect. ERR_CONNECTION_REFUSED
The fact that iisexpress is or is not listening on that port is cascading up to the host VM therefore, but nothing else is getting through.
So I'm a bit at a loss - it almost looks kinda like a binding thing, but as far as iisexpress knows, due to the port forwarding, wouldn't this request be coming from localhost
? How can it tell if it is not? Even that sounds unlikely due to the lack of log messages. Also I never see anything pop up in fiddler.
What I wonder instead if there might be some yet other windows component that sees something bound to 44300, sees an request coming over the network stack, and shuts it down. Is that a thing?