This allows you to access your application on port 80 without root access on Mac OS.
- First, define wich ports you want to redirect to
NON_SSL_PORT=8080
- Then, enable the redirecting rule
echo "\
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port $NON_SSL_PORT\
" | sudo pfctl -ef -
- First, define wich port you want to redirect to
SSL_PORT=8443
- Then, enable the redirection rule
echo "\
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port $SSL_PORT\
" | sudo pfctl -ef -
sudo pfctl -s nat
sudo pfctl -F all -f /etc/pf.conf
Taken from https://salferrarello.com/mac-pfctl-port-forwarding/