Embedding a lightweight web server into a .net application (node.js)?


I have a project built with Awesomium built in .NET and it requires the use of Flash. Flash throws security errors trying to access local content (video player) and the solution(s) Awesomium offers have not been ported to the .NET wrapper yet. I'm wondering if there is a fairly straight-forward way to include a run-time web server in the application where I can just pick some arbitrary port and create a localhost server when the application runs and point my Awesomium browser there.

Any ideas?

7/31/2012 6:04:11 PM

Accepted Answer

NHttp provides an HTTP server with request parsing, but you have to roll your own responses. There's also Kayak, and the framework's own HttpListener.

Nancy is a full MVC framework, supports the ASP.NET Razor syntax, and has lots of options for configuration and extensibility. There's a self-host package available on nuget.

If you just need to serve up a SWF file and some JSON data, the first set would probably be simpler to integrate -- if you need to render full web pages, I would recommend Nancy.

5/22/2013 6:22:56 PM

Here's another alternative I wrote last year and and has served me well.

EmbedIO: https://github.com/unosquare/embedio

I use it mostly to create RESTful services on the Raspberry Pi (soft-float). Updated code for Mono 3.10, support for WebSockets, and Asynchronous handling of requests.

NuGet Package also available.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow