Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Last active October 8, 2015 18:38
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TooTallNate/3372589 to your computer and use it in GitHub Desktop.
Save TooTallNate/3372589 to your computer and use it in GitHub Desktop.
Forward port 80 traffic from 127.0.0.1 to port 3000 at bootup on OS X

Copy this file to: /Library/LaunchDaemons/fwd-80-to-3000.plist and then reboot:

$ sudo -s
$ curl -L https://gist.github.com/TooTallNate/3372589/raw/ace6451e9e47f59550f12d09cb924a64531cfd1f/fwd-80-to-3000.plist > /Library/LaunchDaemons/fwd-80-to-3000.plist
$ reboot
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>fwd-80-to-3000</string>
<key>KeepAlive</key>
<false/>
<key>OnDemand</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/sbin/ipfw</string>
<string>add</string>
<string>fwd</string>
<string>127.0.0.1,3000</string>
<string>tcp</string>
<string>from</string>
<string>any</string>
<string>to</string>
<string>any</string>
<string>80</string>
<string>in</string>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment