Can't reach Polaris server from external computer
mikeTWC1984 opened this issue · 0 comments
Polaris Bug Report
Description of the bug
After executing start-polaris everything works fine internally, but I can't reach that site from outside. After opening up ports on firewall and running "netsh http add urlacl ... " I'm getting 503 error. If I run a site with Flancy (similar PS micro webserver) it works with external request, so I presume some extra setting is needed for Polaris to make it visible from outside?
Steps to reproduce
Start-Polaris -port 8000 # on local
Iwr -uri http://someserver:8000 # from external machine - either hangs or getting 503
update
After some experiments I was able to make it work for http. The key was to have delegate=yes when doing netsh, and using "+" as a host name when starting polaris.
netsh http add urlacl url=http://+:8005/ user=everyone delegate=yes
Start-Polaris -port 8005 -hostname "+"
Howerver this does not fix the issue if using https
update 2
Somehow https start working externally on some specific ports if I use the ip address as hostname parameter (not working with + or actual host name). Also need to add sslcert to that port (I did it before reporting the issue, so the IP was the fix). But still can't recreate it on new ports
I also used base aspnet core app (instaled with 'dotnet new webapp' command). It works just fine using it's built in ssl cert. I only need to add urlacl (no need to set sslcer with netsh). So it's probably a better idea to switch to Kestrel. I think httplistener might be a good option to run stuff locally, for example for webapps as an alternative to WPF.