You need to create two instances of HttpServer, one for http and one for https. I tried to find out why this restriction exists, because I know that the HttpListener can handle registration as for the same listener.
In any case, if creating two instances of HttpServer is really not right for you, you will need to look at the Katana project and Microsoft.Owin.HttpListener. This supports multiple addresses, but unfortunately Katana's startup code does not work by default! But I'm sure there is a way to configure the HttpListener at startup to make this possible.
source share