Recently, I needed a small web server for a
project I was working on. I needed to run it in a UWP background task on Windows 10 IoT Core, so my options were a bit limited.
The
ms-iot/samples repository has quite a few gems. In particular, the
IoTBlocky Sample has a very basic web server called
SimpleWebServer. I ended up adding some support for parameters, but otherwise was very happy about how fast I got a web server hosted in my code.
The one deficiency is the lack of
SSL support:
A StreamSocket object can be configured to use SSL/TLS for communications between the client and the server. This support for SSL/TLS is limited to using the StreamSocket object as the client in the SSL/TLS negotiation. You cannot use SSL/TLS with the StreamSocket created by a StreamSocketListener when incoming communications are received, because SSL/TLS negotiation as a server is not implemented by the StreamSocket class.
I was hoping I was incorrect about this, but I haven't found any evidence to the contrary. With .NET Standard 2.0, I hope to find something else I can include instead.