Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug:/Enhancement:/Feature Request: "No server connection. Retry in 5s..." #27

Closed
halictuz opened this issue Feb 12, 2023 · 10 comments
Closed
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@halictuz
Copy link

Describe the bug
No server connection. Retry in 5s...

To Reproduce
Steps to reproduce the behavior:

  1. Install Docker with the description here on github.
  2. start it up behind caddy reverse proxy
  3. go to domain in browser
  4. See error "No server connection. Retry in 5s..."

Expected behavior
Expect it to work even if "X-Forwarded-For" is not set. Or at least have the guide reflect that it wouldn't work at all without it.

Screenshots
https://ibb.co/VSFJYpZ

Desktop (please complete the following information):

  • OS: Fedora Silverblue / Fedora Workstation / Arch Linux
  • Browser: Librewolf, default Firefox, default Chromium
  • Version: All latest versions available (non beta)

Smartphone (please complete the following information):

  • Device: Pixel 7 / Pixel 4
  • OS: GrapheneOS/Google Android
  • Browser: Vanadium / Android Chrome / Bromite
  • Version: latest non beta

Additional context
It also doesn't seem to work even with X-Forwarded-For set. Unless I got the synthax wrong for Caddy proxy, because there is only a description for Nginx and Apache unfortunately.

@schlagmichdoch
Copy link
Owner

Literally the first sentence in the docs in section HTTP-Server:

When running PairDrop, the X-Forwarded-For header has to be set by a proxy. Otherwise, all clients will be mutually visible.

PairDrop is also working without setting up the header but than all connected clients are shown to everybody as they all seem to have the same IP address.

Probably this happens because your HTTP server does not route your websocket requests correctly. Therefore, those requests fail and the client shows a message that the server is not reachable. Be sure that websocket requests (wss) that are all pointing to /server are not redirected to https as they than fail.

Be sure to follow the documention and have a look at the Apache configuration example: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#using-apache
specifically:

	RewriteEngine on
	RewriteCond %{HTTP:Upgrade} websocket [NC]
	RewriteCond %{HTTP:Connection} upgrade [NC]
	RewriteRule ^/?(.*) "wws://127.0.0.1:3000/$1" [P,L]

@schlagmichdoch schlagmichdoch added the duplicate This issue or pull request already exists label Feb 13, 2023
@schlagmichdoch
Copy link
Owner

Probably duplicate of #24

@halictuz
Copy link
Author

halictuz commented Feb 13, 2023

Literally the first sentence in the docs in section HTTP-Server:

When running PairDrop, the X-Forwarded-For header has to be set by a proxy. Otherwise, all clients will be mutually visible.

PairDrop is also working without setting up the header but than all connected clients are shown to everybody as they all seem to have the same IP address.

Probably this happens because your HTTP server does not route your websocket requests correctly. Therefore, those requests fail and the client shows a message that the server is not reachable. Be sure that websocket requests (wss) that are all pointing to /server are not redirected to https as they than fail.

Be sure to follow the documention and have a look at the Apache configuration example: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#using-apache specifically:

	RewriteEngine on
	RewriteCond %{HTTP:Upgrade} websocket [NC]
	RewriteCond %{HTTP:Connection} upgrade [NC]
	RewriteRule ^/?(.*) "wws://127.0.0.1:3000/$1" [P,L]

As I said, I use Caddy. I don't use Apache. And I've rules set to upgrade to https. Also, the thing about X-Forwarded-For was an assumption because it was the only variable in my testing that changed / was not already set.

And literally the last sentence: "It also doesn't seem to work even with X-Forwarded-For set. Unless I got the synthax wrong for Caddy proxy, because there is only a description for Nginx and Apache unfortunately."

I mean, it doesn't help anybody when you just copy paste this, set it to "duplicate" and call it a day. Because #24 has nothing to do with Caddy.

@schlagmichdoch schlagmichdoch added documentation Improvements or additions to documentation and removed duplicate This issue or pull request already exists labels Feb 15, 2023
@schlagmichdoch
Copy link
Owner

HTTP to HTTPS Redirect should be fine. Can you check whether this is implemented correctly? A websocket request (wss://) should not be redirected to https.

In the network tab in the developer tools if your browser you can check the answer of your request to /server/webrtc. It probably says sth like „a HTTP request can not be answered by a WS and fails“

I don’t know anything about caddy. If you provide your current caddy configuration for PairDrop I can have a look though

@schlagmichdoch schlagmichdoch added the help wanted Extra attention is needed label Feb 15, 2023
@ovizii
Copy link

ovizii commented Feb 20, 2023

I am having a similar issue, and I am using traefik as reverse proxy. I previously used snapdrop. I use other containers behind the same reverse proxy which also need wss and they work.

Let me see what I can contribute. If it sounds like a different issue, please let me know and I'll open my own thread.

I have my self-hosted pairdop open in Chrome on my Android phone and on 2 Win 10/11 laptops. Only 1 laptop is in the same network as the phone.

I checked the browser console and found these on the laptop NOT on the same network as the phone:
image

On the laptop in the same network as the Android phone:
image
image

@ovizii
Copy link

ovizii commented Feb 20, 2023

btw. I see the same errors in the browser console even when using https://pairdrop.net - I hope tis not a browser extension, could someone check their browser console please?

@schlagmichdoch
Copy link
Owner

I pushed some stability fixes in the last 2 weeks. Do these issues persist?

@ovizii
Copy link

ovizii commented Mar 6, 2023

Those probs seem gone for me now, thanks.

@schlagmichdoch
Copy link
Owner

Awesome! @halictuz what about you?

@schlagmichdoch
Copy link
Owner

As @ovizii approved that this is not an issue anymore, I will close this for now. Feel free to reopen if the problem persists @halictuz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants