开发者

Binding on privileged ports (ports < 1024) on Mac OS X 10.6

Do you know how to remove restriction on binding to ports开发者_如何学C < 1024 with a user account that is not root on Mac OS X?


The best way is to leverage launchd. The restriction on binding to ports < 1024 will still be there and is not likely to go anywhere, but if your app requests elevated privileges once in order to add the necessary launchd configuration, then you can let launchd do the actual listening on the privileged port and pass the socket to your app when appropriate.

See the section on launchd in this OS X Developer Library reference, and the further references given there for learning more about launchd and how to use it safely.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜