I am creating a Nancy Module that will eventually be hosted inside of a Windows Service. I am currently running it inside of a WPF test application. To start the Nancy hosting, I am using Nancy.Hosting.Self and calling:
nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:8080"));
nancyHost.Start();
On my local machine I am able to go to a web browser and access my module by entering http://localhost:8080 into the address bar.
If I go to another machine I am not able to access the service. My Windows Firewall is turned off.
If I start the hosting with anything other than localhost in the baseUri, I get an "access denied" exception upon calling nancyHost.Start();
Is there something that I am missing? Should I be able to access the Nancy module from any machine as long as I know the IP:Port to the machine doing the hosting? Is there any type of "host headering" that I need to be aware of?
Thanks for your help with this.
Windows will prevent you from listening on ports without permission. You can either run your process as administrator, or add permission using "netsh":
netsh http add urlacl url=http://+:8080/app user=domain\user
The "+" is a wildcard so it can listen on any IP.
Normally you'd handle the latter during installation, so you may want to run as admin to debug, then make sure your installer sets the relevant permissions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With