❔ Native App with integrated webserver for localhost - almost impossible?!
I thought I have a relative simple requirement but somehow it isn’t :
My goal is to develop a native App with an „integrated“ webserver to serve some dynamic pages to localhost. Basically I want my app to read UDP data, process it and view it on a local webpage in order to use it for overlays in OBS Studio for streaming. Focus is on performance. I have the UDP part working but now I`m struggling.
I came across the .net MAUI Blazor App (Blazor hybrid) which is almost the right thing if it would be possible to access the pages also from outside the app but as far as I researched thats is not possible.
I looked at ASP.net but that doesn’t seem to be the correct choice if I just want a native app without a dedicated server.
I am new to the .net ecosystem but I researched the last week and haven't found a real answer.
7 Replies
i'm not sure what you mean by accessing the pages from outside the app
what I would immediately think of is a razor pages ASP.NET Core project with a hosted background service that scans your UDP data or whatever
and just serves it up as pages
unless you specifically mean a phone app...?
Browser on the same machine. What I basically need is using the page as an overlay in OBS for streaming.
No. It would be windows application only.
Can a asp.net core project be a windows application with tastbar icon / autostart / ..etc?
And I wanted a clean architecture so I was thinking that the background process was too limiting in that way.
an ASP.NET Core project is essentially a console app with a whole lot of nuget packages added in, so yes, you can arrange for it to have all of those things
i don't know how OBS overlays work, but you can absolutely have an ASP app that lives on your computer and delivers pages to localhost - i've done it
My focus is also on ease of use and publishing. Ideally the user only has one .Exe
Obs basically just displays a webpage for you to use as an overlay. With background of the page set to transparent you can do great stuff
Basically a "normal" modern app which also serves some stuff via webpages on localhost
i don't remember if you can publish an ASP app purely to one .exe ... i think there's always going to be, like, config files or whatever. but you can get close
and yeah, you can just have an ASP app that references a class library that does anything else you want
you could probably hack a console app into serving pages over HTTP if you were really determined, honestly
I was hoping to get the most simple, non-hacky solution possible 🙂
As long as its easy to use and share I am fine. The „one .exe“ was just to get across my point.
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.