How to open a specific port in Firewall OS X 10.9.4
I had the same issue under OS X Yosemite (10.10.3).  Found this blog post that provides clear instructions.  We can't use ipfw any more, as it's deprecated.  Instead, use pfctl, which unfortunately lacks a nice command line way to tell it to open a port.  Instead, you need to:


Open /etc/pf.conf in a text editor.
Add a line like this: 



  # Open port 8080 for TCP on all interfaces
  
  pass in proto tcp from any to any port 8080



Save the file.
Load the changes with:



  sudo pfctl -f /etc/pf.conf


If you need to open a udp port, change tcp to udp, if you need both, add a second line.  Additional detail can be found in man pf.conf.

Also make sure your server is listening on the actual interface you want it accessible over (or all interfaces, using 0.0.0.0 or ::0), not localhost (127.0.0.1 or ::1).