macOS 转发对 80 端口的访问到指定端口

To forward all port 80 traffic to port 8080, you can enter the following from the Terminal command line.

echo "rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 2018" | sudo pfctl -ef -

Taken from https://salferrarello.com/mac-pfctl-port-forwarding/ stackexchange