Windows 10 Firewall and Ports

Run Command Prompt as Administrator

Display ports connection and status:
C:\>netstat

To show which program is using the port:
C:\>netstat -aonb | more

Open ports in firewall:
Run firewall.cpl to open ports
Select “Inbound Rules”
On the Right Side, Under Actions,
Click on New Rule.

Open ports in firewall in Command Prompt,
Example:
C:\>netsh advfirewall firewall add rule name=LocalWeb protocol=TCP localport=4080 action=allow dir=OUT