Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 291
S16 Avatar asked Jul 31 '12 18:07

S16


People also ask

Can NodeJS act as a web server?

Node. js is an open source server environment.

Is .NET a web server?

The ASP.NET Development Server is an alternative web server option for the development environment; it ships with and is integrated into Visual Studio.

Can I use node js with ASP NET?

This NuGet package provides a fast and robust way to invoke Node. js code from a . NET application (typically ASP.NET Core web apps). You can use this whenever you want to use Node/NPM-supplied functionality at runtime in ASP.NET.


2 Answers

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.

like image 78
lnmx Avatar answered Nov 13 '22 21:11

lnmx


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.

like image 11
Mario Avatar answered Nov 13 '22 23:11

Mario