EACCES means it is forbidden to listen on port 443. This is because you're not running your app as root. Ports below 1024 are reserved ports, and only root may use them.
Trying to change the firewall rules will have no effect, as firewalls let packets go through or stop them. They do not allow someone to listen to any particular port.
Solution : run your code with sudo, but this may be a security risk. So your app should switch to another user (or find some other mechanism I am not aware of to drop privileges) as soon as possible, just after the successful listen.
Since this is complicated, a good solution is
- your app listen on the
loopback interface on a non privileged port, say for example 127.0.0.1:10443
- You setup a webserver to proxy requests from
0:443 to 127.0.0.1:10443. nginx come to mind but many other servers are usable for this task. Just pick your favorite one.
If you want SSL on port 443, which is usually the case, you should also set up certificates (create a self signed one or buy one or better still, get a free certificate from let's encrypt), configure protocols, available ciphers etc... This is also complicated.
Example minimal nginx config file that needs improvement and should work (can't test right now):
server {
server_name me.example.com;
listen 0.0.0.0:443 ssl;
ssl_certificate /etc/mycerts/fullchain.pem;
ssl_certificate_key /etc/mycerts/privkey.pem;
ssl_session_timeout 30m;
ssl_session_cache shared:SSL:400k;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
server_tokens off;
charset utf-8;
location / {
proxy_pass http://127.0.0.1:10443/;
}
}