Last active
March 12, 2021 00:21
-
-
Save f1sherman/843f85ea8e2cbcdb40af to your computer and use it in GitHub Desktop.
Revisions
-
f1sherman renamed this gist
Oct 10, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
f1sherman created this gist
Oct 10, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ 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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.apple.pfctl-myname</string> <key>Program</key> <string>/sbin/pfctl</string> <key>ProgramArguments</key> <array> <string>pfctl</string> <string>-e</string> <string>-f</string> <string>/etc/pf-myname.conf</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <false/> </dict> </plist> ``` Run the following command to have it start at boot: ```shell sudo launchctl load -w /Library/LaunchDaemons/com.apple.pfctl-myname.plist ```