sgreben / http-file-server

tiny portable HTTP file server. single binary, no dependencies. linux, osx, windows. #golang
MIT License
214 stars 40 forks source link

start server: listen tcp :443: bind: permission denied #13

Open monomycelium opened 2 years ago

monomycelium commented 2 years ago

I love this speedy file server! But when I start the server, I cannot use ports 80 and 443 (because they are restricted, I believe), so I have to start as root. Is there a workaround? I have apache, the webserver, installed on my server running Arch Linux ARM, so a user http was created. But starting the server from that user still can't bind to those ports.

majal commented 1 year ago

In Linux, port numbers below 1024 are privileged ports. The can only be bound using root or sudo privileges. There are workarounds, but they tend to be complex.

Example: https://stackoverflow.com/q/413807