Adrian
Adrian

Reputation: 20068

How to run Boost.Asio server on port 80?

I have a simple boost.asio server which I am trying to run it on port 80. I am running the code inside a try-catch and I get a "bind" exception error. The value of boost::error_code is 13 which I think is "access denied".

I am running the code from Xcode on Mac running Yosemite. I also tried to run Xcode with sudo.

How can I fix this issue ?

Upvotes: 1

Views: 183

Answers (1)

sehe
sehe

Reputation: 393134

Run as root.

The problem is that you don't have the permission to bind to a privileged port (<1024 on most systems).

If you're certain that the child process of Xcode runs as root, find out which process is already listening on port 80 (lsof and netstat)

Upvotes: 2

Related Questions