Binding to privileged port in iPhone simulator

I have a use case where I need to run a simple HTTP server while listening to iOS on port 80.

On a device that works great on a simulator, I get a bind error, of which port 80 is privileged. This is not critical, but makes testing more difficult than necessary.

On Linux, you can give individual applications access to privileged ports through "setcap" cap_net_bind_service = + ep '/ path / to / program.

How does this work on OSX so that iPhone Simulator can bind to a privileged port?

+4
source share
1 answer

This is not an answer, but you can redirect traffic from other ports (if you can, for example, start an HTTP server on port 20080 ), to port 80 using ssh :

 ssh -L 80:<iOS Device IP>:20080 localhost 

Or socat :

 socat TCP-LISTEN:80,fork TCP:<iOS Device IP:20080 

Then you can access (you can edit /etc/hosts with a fancy name):

 http://localhost/ 
0
source

Source: https://habr.com/ru/post/1368851/


All Articles