Create simple embedded http and https applications in C#

陌路散爱 提交于 2019-12-18 13:17:15

问题


There is a simple http server API that allow you do some simple stuff quickly, without any addition dependency/installation required.

Are there any similar API/library in .NET WITHOUT IIS?

For example, I am a small window service running, I'd like to add a simple stupid web interface to allow local/remote control/monitoring.


回答1:


HttpListener hooks into HTTP.SYS even without IIS, I believe.

You'll need to add priveleges to the service account, though - netsh on vista, httpcfg on xp ("how" covered here).




回答2:


In addition to the previously mentioned webserver project on codeplex, which I've used in a production application, another simple HTTP server API option is Kayak. Kayak appears to be in an early development stage. It hasn't reached 1.0 yet.

UPDATE: I noticed that my original link to Kayak broke recently. The main website for Kayak has moved to http://kayakhttp.com/ but the code is hosted on Google code: http://code.google.com/p/kayak/.

UPDATE 2: Apparently, the Kayak source code has moved yet again, this time to GitHub: https://github.com/kayak/kayak/.

UPDATE 3: the webserver is "being migrated" to a networking library, also at GitHub: https://github.com/jgauffin/griffin.networking




回答3:


A quick Google gave me many examples of this, such as Creating your own web server using C#.

Note, that is a very old article, there are probably more concise ways to do this now.

Edit: another nice example here.



来源:https://stackoverflow.com/questions/458036/create-simple-embedded-http-and-https-applications-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!