echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -
sudo pfctl -F all -f /etc/pf.conf
sudo pfctl -s nat
-original source https://salferrarello.com/mac-pfctl-port-forwarding/