I am trying to start host with IP https://0.0.0.0:9000
with Nancy Host
but am getting System - The request is not supported
exception. Below is my code.
string strHostProtocol = "https";
string strHostIP = "0.0.0.0";
string strHostPort = "9000";
var url = strHostProtocol + "://" + strHostIP + ":" + strHostPort;
this.host = new NancyHost(new Uri(url));
this.host.Start();
It will allow me to start other IP address like 127.0.0.1:9000
, 192.168.100.10:9000
etc., but not 0.0.0.0:9000
. I've read that this is a valid IP. But my question is why this is not allowed to start? Is this IP reserved for any purpose?
Update
The sole purpose here is, I am trying to access a internal IP through a public IP provided. But Nancy even though starts internal IP with port, when request is provided through public IP, it will not recognize. Not sure whether this is achievable or not.
I figured out how:
HostConfiguration hostConf = new HostConfiguration();
hostConf.RewriteLocalhost = true;
var apiHost = new NancyHost(hostConf, new Uri("http://localhost:8080"));
apiHost.Start();
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