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

心不动则不痛 提交于 2019-12-01 14:31:18

问题


Do you know how to remove restriction on binding to ports < 1024 with a user account that is not root on Mac OS X?


回答1:


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.



来源:https://stackoverflow.com/questions/7612053/binding-on-privileged-ports-ports-1024-on-mac-os-x-10-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!