WebDeck icon indicating copy to clipboard operation
WebDeck copied to clipboard

"this site can't be reached" on mobile

Open hannesdelbeke opened this issue 11 months ago • 12 comments

Describe the bug when i scan the QR code with my phone, it tries to connect to the IP adress in my browser. It fails to connect, and says "this site can't be reached" on my phone.

To Reproduce Steps to reproduce the behavior:

  1. download portable exe
  2. run exe, a qr shows
  3. scan qr with phone

Expected behavior display the webdeck in the browser on my phone

Screenshots If applicable, add screenshots to help explain your problem.

Desktop:

  • OS: windows 11
  • Browser chrome
  • Version n.a.

Smartphone (:

  • Device: honor 10 lite
  • OS: android 10
  • Browser chrome
  • Version [e.g. 22]

hannesdelbeke avatar Jan 10 '25 16:01 hannesdelbeke

check if your device is on the same network as your computer and that the software has permissions to open a local port, you can right click on the tray icon to accept the firewall if it is not already done

Lenochxd avatar Jan 10 '25 17:01 Lenochxd

I tried to accept firewall, and restart my pc, but no luck. I also tried on another laptop, but no luck either. both pcs can deffo see each other since i m using barrier between them.

i just found another repo https://github.com/tarneaux/web-streamdeck that seems to use the same tech (flask and python) and the same ip address and port. (but it seems a bit more barebones) and this seems to work on my devices. so it seems to be something related to your repo i'm afraid.

hannesdelbeke avatar Jan 10 '25 18:01 hannesdelbeke

Maybe try changing the port in the configuration file otherwise I don't know. This kind of problem is complicated to fix as I don't have access to your exact network configuration, so I can't do any tests

Lenochxd avatar Jan 10 '25 18:01 Lenochxd

i have no idea neither about webdeck nor windows, but maybe the user has more than 1 network interface and the qr code (i assume its just generating a link somehow) generator is picking up the wrong ip. possible cases would be:

  1. more than 1 physical interface (lan + wifi)
  2. a vpn like interface like wireguard or tun/tap devices from openvpn or similiar services
  3. a virtual interface because something is virtualized

my solution would be, for a quick fix: try to get your ip adress manualy on the host where webdeck is installed and generate the link yourself

long term solution: either generate a qr code for every interface available or make the qr code generation more flexible, eg. like a template string 'http://{if[2].ip}:{app.port}/'

beware, im just guessing the cause ^^

thelittlebug avatar Jan 30 '25 15:01 thelittlebug

The qr code should always be right, even when the local network is poorly configured the qr code shows an ip that can be reached.

# get_local_ip.py
def get_local_ip():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        # Any address and port, here we use Google DNS
        s.connect(("8.8.8.8", 80))
        local_ip = s.getsockname()[0]
    finally:
        s.close()
    return local_ip
  1. I haven't tried it but I think it could be the case, seeing how windows works when it has 2 IPs
  2. if the user uses a VPN or proxy service, the web page would probably either not even start loading or it would have returned a 403 error
  3. nothing is virtualized by default

Lenochxd avatar Jan 30 '25 15:01 Lenochxd

i do have multiple ip's for my computers due to mixed wifi and lan setup but if i remember correctly, i tried to manually type the IP address

hannesdelbeke avatar Jan 30 '25 16:01 hannesdelbeke

in the next version of webdeck (2.0.0) you will be able to select the ip address in the configuration directly to fix this kind of issues, in latest version (1.8.7) you can only select the port

Lenochxd avatar Jan 30 '25 16:01 Lenochxd

Maybe I'm too late, but is your network profile set to private?

N2630 avatar Feb 15 '25 18:02 N2630

Maybe I'm too late, but is your network profile set to private?

no

hannesdelbeke avatar Feb 19 '25 16:02 hannesdelbeke

+1 on the report. Looking forward to the 2.0.0 release that addresses the issue.

One thought / suggestion. If you allow users to launch the app with the IP 0.0.0.0, then it will be accessible from all networks that can access the computer. I have a server that is on 3 networks and it would be best if the Webdeck site was accessible from all 3 of those networks.

Reference https://flask.palletsprojects.com/en/stable/quickstart/ - "Externally visible server" section

hpd avatar Feb 19 '25 16:02 hpd

It is possible to put the host in the config, but it is unfortunately no longer used in version 1.8.7 and will be reintroduced

https://github.com/Lenochxd/WebDeck/blob/6ef3cfbcec0ab6eb154089638828fe2ea7c517c4/main_server.py#L2817-L2818

At the moment it is possible to use a command line argument but still not the config.json value, I will add it soon https://github.com/Lenochxd/WebDeck/blob/51a0b9d7e3f476e5e544d64b39c2c53aa8e2b6a4/app/server.py#L538-L539

Lenochxd avatar Feb 19 '25 16:02 Lenochxd

Maybe I'm too late, but is your network profile set to private?

no

You should try to set it to ''Private'' on the windows settings. Maybe this will solve the problem (it works for me).

N2630 avatar Feb 23 '25 08:02 N2630