Web server integration in Windows application
I am developing a Windows application using the .NET framework. I am exploring the best ways to integrate a web server in my application that listens to localhost:8080 开发者_开发知识库(or whatever port). I do not want to compromise on the security of the user so I would like to use some library or existing web server application that is secure and does not have vulnerabilities.
So I rounded myself to 2 ways -
1) Using a popular web-server like nginx or apache - and invoking it through the application (and running it as a process with CreateNoWindow = true;
).
2) Using a web server written in C# or C++ like WebServer.
What would be the best way to do it? I am open to more suggestions.
I have done this 3 ways in .NET
- If it's a web service or Data service your can use the ServiceHost to host your own endpoints
IIS Express is probably the most robust and "proper" solution, unfortunately it's still in beta. You can get it by downloading Webmatrix. http://www.asp.net/WebMatrix
The source code for the webserver embedded in Visual studio is available, it's called Cassini. I've used it on a few projects. It's available as source or even packaged:
http://code.google.com/p/cassini/
http://ultidev.com/Products/Cassini/
精彩评论