Some parts taken from: https://gist.github.com/kujohn/7209628
ipfw
is officially deprecated and removed in OS X Yosemite. If you don't want to run sudo for gaviota-proxy(which then you can also debug) you have to handle the port forwarding with the program pf
.
Create file /etc/pf.anchors/mindflash
, the port forward needs to match your dev.js config for gaviota-proxy.
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 80 -> 127.0.0.1 port 3080
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 443 -> 127.0.0.1 port 3443
Or if you want to connect via wireless
rdr pass inet proto tcp from any to 127.0.0.1 port = 80 -> 127.0.0.1 port 3080
rdr pass inet proto tcp from any to 127.0.0.1 port = 443 -> 127.0.0.1 port 3443
Note: Trailing line break is important.
Insert rdr-anchor "mindflash"
and load anchor "mindflash" from "/etc/pf.anchors/mindflash"
at correct places in /etc/pf.conf
, so that it looks like this:
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
rdr-anchor "mindflash" # mindflash port forwarding
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
load anchor "mindflash" from "/etc/pf.anchors/mindflash" # mindflash port forwarding
Note: pf is not at this time enabled(-e) by default on Yosemite on boot.
You can enable pf manually via sudo pfctl -ef /etc/pf.conf
You can disable pf manually via sudo pfctl -df /etc/pf.conf
However, to enable pf automatically after every boot, save the following as /System/Library/LaunchDaemons/com.apple.pfctl.plist
:
<key>ProgramArguments</key>
<array>
<string>pfctl</string>
<string>-e</string>
<string>-f</string>
<string>/etc/pf.conf</string>
</array>