Add the following to `/etc/pf.anchors/myname`: ```shell rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000 rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001 ``` Add the following to `/etc/pf-myname.conf`: ```shell rdr-anchor "forwarding" load anchor "forwarding" from "/etc/pf.anchors/myname" ``` Add the following to `/Library/LaunchDaemons/com.apple.pfctl-myname.plist`: ```xml Label com.apple.pfctl-myname Program /sbin/pfctl ProgramArguments pfctl -e -f /etc/pf-myname.conf RunAtLoad KeepAlive ``` Run the following command to have it start at boot: ```shell sudo launchctl load -w /Library/LaunchDaemons/com.apple.pfctl-myname.plist ```