Giter Club home page Giter Club logo

Comments (10)

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

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]

from pairdrop.

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

Probably duplicate of #24

from pairdrop.

halictuz avatar halictuz commented on May 21, 2024

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.

from pairdrop.

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

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

from pairdrop.

ovizii avatar ovizii commented on May 21, 2024

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

from pairdrop.

ovizii avatar ovizii commented on May 21, 2024

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?

from pairdrop.

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

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

from pairdrop.

ovizii avatar ovizii commented on May 21, 2024

Those probs seem gone for me now, thanks.

from pairdrop.

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

Awesome! @halictuz what about you?

from pairdrop.

schlagmichdoch avatar schlagmichdoch commented on May 21, 2024

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

from pairdrop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.