HttpListerner in Console App and Web Config

R

Reg

Hello All!

I have a small Console based Application which acts like Http server.
HttpListener is used for Http requests and responses.

Now I would like to use Digest Authentication and I made a IHttpModule based
assembly to handle authentication. Problem is that IHttpModeule based
assembly is configured into web.config but I don't know how HttpListener can
read App.Config to get information considering Digest Authentication module.
How that can be done? Or are there any other ways to implement Digest
Authentication to Console Apps using HttpListener?

Code in Console App is below:

// Create a listener and add the prefixes.

System.Net.HttpListener listener = new System.Net.HttpListener();

foreach (string s in prefixes)

{

listener.Prefixes.Add(s);

}

// Digest Authentication selected

listener.AuthenticationSchemes = AuthenticationSchemes.Digest;

// How to read configuration information from Web.Config file???

try

{

// Start the listener to begin listening for requests.

listener.Start();

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,629
Members
45,330
Latest member
AlvaStingl

Latest Threads

Top