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

S16 picture S16 · Jul 31, 2012 · Viewed 38.6k times · Source

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?

Answer

lnmx picture lnmx · Jul 31, 2012

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.