I am using npm http-server to start a https server with:
http-server --ssl --cert ~/.localhost-ssl/localhost.crt --key ~/.localhost-ssl/localhost.key
It defaults to 8080 port. So I can use https://192.168.22.123:8080
to access. But I wanted to not have to specify 8080 at all, for ex: https://192.168.22.123
. Can it be done?
According to http-server there is a -p
or --port
option. But not sure if or how to do it?
Edited: It seemed like I can redirect to any ports other than well known ports. For example, I have no problem with 8081 or 4000. But if I specified 80, it gave me an error: events.js with Unhandled 'error' and Error: listen EACCES 127.0.0.1:80. I did see other posts that people were using 80.
Any suggestions why mine is not working?