views:

710

answers:

7

I wrote a VB.NET windows service and I'd like to know if there is some library or something that will provide me with a very simple mini web server. If my service is running, I'd just like to be able to type, in my browser:

http://localhost:1234

And have a status page popup. It will only be one single page and very simple html. Anyone know an easy way to do this before I attempt it on my own and over-engineer? lol

+3  A: 

You should look into Windows Communication Foundation. The framework lets you host your own HTTP endpoint, on which you can serve whatever you want. Here is a sample over at MSDN.

Peter Lillevold
That will not help with a *HTTP* server.
Jonathan C Dickinson
Its a good start. Here's a sample on how to serve up a jpeg consumable in a web browser. Its a short way from there to serve up a simple <html><body>Hello world</body></html>. http://msdn.microsoft.com/en-us/library/cc681221.aspx
Peter Lillevold
+5  A: 

Look into the System.Net.HttpListener class. You can specify what port to listen to, and it's up and running pretty quickly.

jean
+4  A: 

if you're using .NET 2.0 you can use System.Net.HttpListener to create your own web server that takes advantage of the HTTP.SYS component which is available from WindowsXP SP2 and Windows 2003 Server.

There's a article about hosting Web Services without using IIS using http.sys at http://msdn.microsoft.com/sv-se/magazine/cc163879(en-us).aspx

MatteKarla
+2  A: 

Try Cassini

+3  A: 

Maybe the Cassini server from Microsoft (or, a variant of Cassini from UltiDev), which is implemented by the same technology as used when you debug ASP.NET or a Web Service from within Visual Studio without IIS.

ChrisW
A: 

Try WebDev.WebServer.exe. You can past parameter with it such us port and directory.

Marc Vitalis
A: 

I actually found a pretty good library of what I was looking for at:

http://www.codeproject.com/cs/internet/minihttpd.asp

If anyone else needs a small mini web site, check out that link. I tried it and liked it.

icemanind