KuroLabs / Airshare

Cross-platform content sharing in a local network

Home Page:https://airshare.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied

zahash opened this issue · comments

PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied

On Windows, hosting a server on port 80 (which Airshare uses as default) is blocked. You might want to change the port using the --port flag or change your system settings to open port 80.

but I use Ubuntu

It's transferring the files after changing the port but not displaying anything on the local server

If you change the port, you must access the server using code.local:port, for example, zahash.local:8000.

As for the port 80 issue, once again ensure that port 80 is open (check ufw). If it is, then ensure you don't have any other applications running on port 80 - this could be something like XAMPP, etc.

Closing this as a solution has been provided.

I would suggest changing the default port on Linux to something that doesn't require any extra privileges when not running as root.
Running Airshare as root also makes any files uploaded to it owned by root and you also shouldn't run random python scripts as root.
I get that adding :8080 to the end of the url doesn't look pretty but the http://code.local is pretty unreliable anyway, so if most people end up using the ip adress, there's not much harm done.

I had my reservations regarding this as it would make the URLs a little harder to type and less "pretty", but I've gone ahead and changed the default port to 8000. We shouldn't be using the restricted ports (below 1000), and this change will probably save us a lot of Bind Error issues.

The addition of just 4 digits for the port number, to the URL isn't too big a deal breaker for me. So, I'm content now that the change has been made (and is part of version 0.1.6 as it's important and required immediate release). Hopefully it reduces the number of duplicate port issues we receive.

Beyond that, if someone does want to use port 80, by all means they are free to do so using the -p flag.

Thanks @mohanpierce99 and @paperbenni.