This is a versatile http server designed to be used in mobile/UWP applications.
Package | Downloads | Stable Version | Pre-release Version |
---|---|---|---|
HttpServer | |||
HttpServer.Json |
-
First install nuget package:
PM> Install-Package Yllibed.HttpServer
-
Register a server in your app:
var myServer = new Server(8080); // create a web server on port 8080 myServer.RegisterHandler(new StaticHandler("/", "text/plain", "Hello, world!")); // register a handler for the root var (uri4, uri6) = myServer.Start(); // start the server and get the URIs
- Simple web server which can be extended using custom code
- No dependencies on ASP.NET or other frameworks, self-contained
- This HTTP server is not designed for performance or high capacity
- It's perfect for small applications, or small need, like to act as return url for OAuth2 authentication using external browser.
- There is no support for HTTP 2.0+ (yet) or WebSockets
- There is no support for HTTPS (TLS)
- Use it for building a headless Windows IoT app (for SSDP discovery or simply end-user configuration)
- Use it for remote diagnostics/monitoring on your app
If you want to open "any" port on a Raspberry Pi running Windows 10 IoT, you may need to open a port.
- First, connect to your device using powershell:
Enter-PsSession -ComputerName <device name or ip> -Credential .\Administrator
- Add a rule in the firewall to authorize inbound traffic to your application: (example for port 8080)
netsh advfirewall firewall add rule name="My Application Webserver" dir=in action=allow protocol=TCP localport=8080