Open firewall to allow port 8001

I recently purchased a MacBook Pro with M3 chip running Sonoma 14.3.1 (to replace a MacBook Pro that used an Intel chip and ran Ventura 13.6.1.)

I need to open Port 2001 to use socket.io for an app I am developing. On the older Mac, I simply entered : sudo ufw allow 8001

Now the Mac apparently uses pfctl as a firewall, but the documentation on how to open a port is not at all clear.

Can you help.

Open firewall to allow port 8001
 
 
Q