views:

66

answers:

2

So I created a TCP\HTTP server (IN C#). I want to give to it namespace on my 80's port near to other HTTP servers I have. How to do such thing (step - by step)?

A: 

The way you would normally interact with http.sys is by registering an ISAPI DLL with IIS. This is a good starting-point.

Dean Harding
So... Amm.. What shall I do Stp by Step? My HTTP\TCP server is written in C# so I realy do not get all that strange stuff...
Blender
You cannot directly register a C# application with ISAPI, but you could write a C++ ISAPI DLL that calls your C# code. I would recommend against that, though, and instead look at using HTTP Handlers: http://msdn.microsoft.com/en-us/library/ms972953. Step-by-step instructions are not really appropriate here, since there are *many* steps... but the links I've given you should be a good starting point.
Dean Harding
+1  A: 

Look at HTTP Server Tasks in MSDN spec:

There is a also a fully fledged application sample at HTTP Server Sample Application.

As you can clearly see, HTTP.SYS API is a C API intended for C applications. You shouldn't be using it from C#, and I'd recommend against pInvoking the entire API. Managed applications have the alternative of using HTTP modules and extend the ASP.Net processing. This avenue will take care of many details needed in a managed server, like activation, hosting, process monitoring and recycling and so on and so forth.

Remus Rusanu
Is it possible to find real file with HTTP.SYS info for editing by hend *(or at least reading it) not using Httpcfg.exe?
Blender
Httpcfg.exe is nothing but a thin shell around the HTTP Configuration API. Everything Httpcfg.exe can do is done via the API. See http://msdn.microsoft.com/en-us/library/aa364455%28v=VS.85%29.aspx
Remus Rusanu