C# HttpListener Prefix issue with anything other than localhost
- by jchristner
Hello,
I'm trying to use C# and HttpListener with a prefix of anything other than localhost and it fails (i.e. if I give it "server1", i.e.
h t t p : / / l o c a l h o s t : 1 2 3 4 works, but
h t t p : / / s e r v e r 1 : 1 2 3 4 fails
(sorry, but the site thinks I'm trying to spam... the spaces are there because of that...)
The code is...
HttpListener listener = new HttpListener();
String prefix = "h t t p : / / s e r v e r 1 : 1 2 3 4/";
listener.Prefixes.Add(prefix);
listener.Start();
The failure occurs on listener.Start() with an exception of "Access is denied.".
Any ideas?
Thanks!