Seeking info on httpweblistener....

  • Thread starter Thread starter smerf
  • Start date Start date
S

smerf

There's damned little that I can find on this little gem. Supposedly it
lets you create a mini webserver a lot easier than using sockets and covers
things like SSL encryption and authentication.

From what I can find it requires XP SP2 and above (can anybody verify
that?).

And, if you know of (or can find) any supporting info or code examples, I
would definitely be grateful.

Still searching......
 
FYI : One other little irritating issue is that this class can only be run
under administrator privileges.
 
I saw that....but it looked to me like you had to have access to the machine
to make this work-around work.

There really is no way to distribute an app to the general population that
can use this class - that I can find.
 
The application in the link you provided does not work (at least on my XP
SP2 PC).

It doesn't see any accounts (admin or limited).
 
run the tool and enter a, you wil be prompted to enter an account, press
enter when done and the tool will return the command to enter from the
commandline.
Note that this is a sample tool, it includes the source so it can be easily
adapted to suit your specific needs.

Willy.

PS. Don't crosspost to inappropriate NG's. This question belongs to the
,microsoft.public.dotnet.framework.aspnet.security.

| The application in the link you provided does not work (at least on my XP
| SP2 PC).
|
| It doesn't see any accounts (admin or limited).
|
|
| | > Hello, smerf!
| >
| > s> FYI : One other little irritating issue is that this class can only
| > s> be run
| > s> under administrator privileges.
| >
| > Nope, that's not true.
| > you can use httpcfg.exe util to configure HttpListener to work on some
| > other account.
| > Have a look at
| > ( http://www.leastprivilege.com/HttpCfgACLHelper.aspx )
| >
| > s>
| > s> | >>> There's damned
| > s> little that I can find on this little gem. Supposedly
| >>> it
| >>> lets you
| > s> create a mini webserver a lot easier than using sockets and
| >>> covers
| > s> things like SSL encryption and authentication.
| >
| >>> From what I can find it
| > s> requires XP SP2 and above (can anybody verify
| >>> that?).
| >
| >>> And, if you
| > s> know of (or can find) any supporting info or code
| >>> examples, I
| >>> would
| > s> definitely be grateful.
| >
| >>> Still searching......
| >
| >
| >
| > searching......
| >
| >
| >
| >
| > --
| > Regards, Vadym Stetsyak
| > www: http://vadmyst.blogspot.com
|
|
 
smerf said:
There's damned little that I can find on this little gem. Supposedly it
lets you create a mini webserver a lot easier than using sockets and covers
things like SSL encryption and authentication.

From what I can find it requires XP SP2 and above (can anybody verify
that?).

And, if you know of (or can find) any supporting info or code examples, I
would definitely be grateful.

I have a very simple example:

using System;
using System.IO;
using System.Net;

// two valid URL's
// http://localhost/test/show
// http://localhost/test/exit
public class WebServer2
{
public static void Main(string[] args)
{
HttpListener srv = new HttpListener();
srv.Prefixes.Add("http://localhost/test/");
srv.Start();
while(true)
{
HttpListenerContext ctx = srv.GetContext();
HttpListenerRequest req = ctx.Request;
HttpListenerResponse resp = ctx.Response;
StreamWriter sw = new StreamWriter(resp.OutputStream);
if(req.Url.AbsolutePath == "/test/exit")
{
sw.WriteLine("Goodbye");
sw.Close();
break;
}
else if(req.Url.AbsolutePath == "/test/show")
{
foreach(string hdrnam in req.Headers.AllKeys)
{
string hdrval = req.Headers[hdrnam];
sw.WriteLine(hdrnam + " = " + hdrval + "<br>");
}
}
else
{
sw.WriteLine("Unknown URL");
}
sw.Close();
}
srv.Stop();
srv.Close();
}
}

Arne
 
Back
Top