Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

if I try to run my program that uses HttpListener without root it throws this exception.

Unhandled Exception: System.Net.Sockets.SocketException: Access denied
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in :0
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in :0
  at System.Net.EndPointManager.GetEPListener (System.Net.IPAddress addr, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in :0
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in :0
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in :0

How can I allow HttpListener to be used by users besides root?

share|improve this question

If you want it to listen on port 80, it'll need to be started by the root user. If you're okay with it listening on a port > 1024, then any user should be able to start it.

If you want other users to be able to start this listening on port 80, then you'll need to allow them to run it via sudo.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.