claudiodangelis / qrcp

:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.
https://qrcp.sh
MIT License
9.89k stars 524 forks source link

"Can't connect to the server" #286

Closed effeottantuno closed 8 months ago

effeottantuno commented 11 months ago

Hi, i've recently got a new pc and now qrcp won't work, when i scan the qr code on both my iphone using ios and my android using firefox i get this:

photo_2023-08-07_01-20-51 photo_2023-08-07_01-20-46

effeottantuno commented 11 months ago

i've also tried using the --keep-alive tag but still nothing.

claudiodangelis commented 10 months ago

Hello @effeottantuno , try to pass the port number using standard ports, for example:

qrcp --port 8080 yourfile

And let me know if it works this way, it might be a firewall issue.

Thanks! Claudio

basketshoe commented 8 months ago

@claudiodangelis I'm having the same issue, even with port 8080. Tried with iOS 16.7.1 Safari and DuckDuckGo

effeottantuno commented 8 months ago

@claudiodangelis same as @basketshoe not working even with 8080, tried on android 14 using firefox

claudiodangelis commented 8 months ago

Please reach out to my email (my github username + gmail.com) or through Telegram (same github username), we can debug together privately. Thanks!

claudiodangelis commented 8 months ago

After some debugging with @basketshoe and @effeottantuno it turned out that issue was caused by firewalld blocking incoming connections.

To permanently open a specific port run the following command, replacing 8080 with your preferred choice:

sudo firewall-cmd --permanent --add-port 8080
sudo firewall-cmd --reload

Run the tool using that port:

qrcp -p 8080

Remember that you can permanently configure the tool to use a specific port by adding this to the configuration file:

port: 8080

Also, read the documentation of firewalld for understanding the consequences of opening ports and to find right configuration for your needs: https://firewalld.org/