I have created a ServiceStack Windows service which runs an AppHostHttpListenerBase
. I can get it to listen for remote requests by listening on the private IP address of the server (e.g. http://1.2.3.4:8080/
. In such cases, I can consume the services across the Internet using the server's public IP address, but requests executed on the server to http://localhost:8080/
fail.
If I change the binding address to http://*:8080/
, then requests to localhost
succeed, but I can no longer access the server across the Internet; I get a 503 Service Unavailable.
Any ideas how I can have my web services listen to both local requests and requests across the Internet?
And, just as importantly, why is it that when loosening the restriction on the listening address from a specific IP to a *
do requests across the Internet suddenly start to fail?
It could be that some other listener is already handling the request, and the * only matches those not handled. I would just try to listen to http://+:8080/
in the hope that it helps.
For further information on HttpListenerPrefix see https://msdn.microsoft.com/en-us/library/system.net.httplistenerprefixcollection.add(v=vs.110).aspx
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