Sto usando macOS Sierra 10.12.4 e sto provando ad aprire una porta (12345). Non riesco a utilizzare lo strumento firewall GUI poiché è specifico dell'app, non specifico della porta.
 Ho provato il seguente  questo articolo , ma non lavoro. Quando eseguo   sudo pfctl -f /etc/pf.conf    ottengo: 
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel
ALTQ related functions disabled
Potrebbe anche essere utile notare che nelle opzioni del mio firewall (GUI) ho bloccato praticamente tutte le opzioni come mostrato di seguito.