-
-
Notifications
You must be signed in to change notification settings - Fork 292
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] Cross device Peers are not discoverable #215
Comments
Yes I did setup local turn server but same result. I can see the logs and connection seems to be established but not shown on the UI though
|
It does say
It works on pairdrop.net but not my self hosted one Any ideas how I can debug this ? |
I have already deployed coturn alsong side the pairdrop. This is how my docker compose looks like
Here are my configs for coturn and pairdrop respectively
I will in different browsers and get back on this |
Okay. I was able to test on chrome browser instead of Brave and it works. So i'm confused why everything works on pairdrop.net but not brave mobile does not work on my self hosted one |
Have you fixed your turnserver.conf? |
Yeap. Updated my turnserver.conf to include static user and removed DB Funny thing is on brave browser and mac, both get notification that it got connected but it wont show in the peers |
So the issue only happens on Brave and only with your self hosted version behind a VPN, correct? Is your TURN server publicly available? Then you could also test it with this tool: https://icetest.info/ If your TURN server is behind the VPN too, maybe there is a way to run the icetest library on your device behind the VPN: https://github.com/tgabi333/ice-test
This is due to the signaling server working as expected but the WebRTC connection failing. As the (edited) deviceNames are transferred between the devices only without ever being sent to the server, the Edit Dialog shows "undefined" as long as there hasn't been a successful WebRTC connection. Probably, we should prefill the IndexedDB with the generated device names though. I'll create a separate issue for that. |
Ok, So I tested on icetest.info and it seems to be okay.
|
Yes that is correct.
It fails on both devices. I have manually connected each one and both the sides it always show |
Works here as well |
Sure, that's always a good idea. Do you have any extensions installed on Brave? |
I just tested on Firefox and opera and they both work fine. I think i found the problem. It with the rtc_config.json here is the original
here is the one that fixed the issue
I was looking though the console and found some requests failing with |
This also brings another question |
Good catch! Glad it works now! Beware that you can additionally implement TURN over TLS which would make the url
I'm not sure what you question is. What fallback are you talking about? Are you maybe confusing Websockets and WebRTC? |
I saw in the console logs once the turn connection failed, I think it tried websockets as I enabled But this |
I'll close this as this is fixed. Thanks again for all the help and amazing work! |
Currently the websocket fallback is implemented in such a way that it is only used if one of the devices is not able to use WebRTC at all. Only if As this led to confusion another time we should maybe change the behavior into a real fallback: If the WebRTC connection fails (3 times?) the websockets fallback is used instead. What do you think? |
Ahh I see. I assumed otherwise.
This makes sense and seems like the behavior I would expect when I see WS_FALLBACK. So the server would open up a websocket connection with each peer then ? |
It already does but it is mainly used for grouping peers together and signaling the WebRTC information. With the WS_FALLBACK active, files and messages are sent to the server as well and relayed by the server to the selected peer, so the transfer is not peer to peer. I like the idea of implementing it as a real fallback but the traffic will need to be encrypted first. |
@schlagmichdoch Sorry for digging this a little old issue. I know that you are working on a enhancement to make ws fallback the real fallback, at the same time, is there a way for the server to enforce websocket? |
I have not changed the connection logic everything should work as before. In many cases no TURN server is needed to connect devices via WebRTC so I guess that is what happened. If the ws fallback is used, connected devices are marked with a red border. Was that the case for you? I'm reluctant to enforce the ws fallback via a config file as the WebRTC solution is much faster (esp. in the next version 1.11.0) and more secure. |
Also, let's continue the discussion over at #228 as this issue is closed and not related. |
The following comments were deleted by GitHub (via hubot) as part of mistakenly marking this account as spam on 17th February 2024. The correct thread order and the creation date is unclear. I decided to manually restore them anyway in order to complete the information this issue holds even though the restored information might be outdated: Comment by @schlagmichdoch:If this only happens on your self hosted instance: Have you set up a TURN server for PairDrop? This is needed for some cross-device connections to work Comment by @schlagmichdoch:It may be, that your VPN blocks WebRTC completely. Can you try to switch it off or check if there is an option for allowing WebRTC? Your devices must be able to create WebRTC connections to be able to use PairDrop. Visit this page with your device to check if WebRTC is supported: Next to You can also try to use pairdrop.net with your VPNs enabled. If this breaks the functionality, probably your VPN is blocking WebRTC Comment by @schlagmichdoch:
It appears your VPN is hosted on the same device as PairDrop sees local IP addresses. All devices with paired devices will always see each other mutually so there would be no need for pairing. If two macs can connect to each other, this should normally work with a mobile device too. It may be though, that the macs only need the STUN server (easy) and the mobile needs to use the TURN server. So if your TURN server is not configured correctly it may only be a problem for some connections. To make deploying a TURN server alongside PairDrop the docs will be updated in Also, have you tried using other browsers than Brave? Comment by @schlagmichdoch:Thanks for the logs and confs. If
I believe the issue is that you use a credential database but don't specify these credentials in your rtc_config.json. You will probably create a new user for your TURN server like so: sudo turnadmin -a -u username -p password --db /var/db/turndb Your rtc_config.json then needs to be:
See here: https://dev.to/masanori_msl/coturn-add-turn-users-into-a-database-1bga If you don't want to use the database you can also specify credentials directly in the turnserver.conf by removing the database line and adding:
Comment by @schlagmichdoch:Ok, thanks for testing.
Your self hosted instance works correctly using Google Chrome and pairdrop.net also works using Brave. Is this correct? When it is not shown on Brave is the Brave device shown on your Mac or does it fail on both devices then? Comment by @schlagmichdoch:Also, try using this instance https://pairdrop-next.onrender.com to rule out Brave is somehow whitelisting pairdrop.net as it is quite popular but blocks something on other instances. |
Describe the bug
I'm able to see each other peers between two macs but when I open it on mobile browser, mobile peer is not shown even though I can see peer connected through logs. Also, I'm able to pair the mac and android as well and it doesn't show up. I see the attached screenshot on android and on mac under peer list, android peer also shows undefined.
Expected behavior
I expected peer from android is showed up on macs and vice-verse
Screenshots
Smartphone (please complete the following information):
Bug occurs on official PairDrop instance https://pairdrop.net/
No
Version: v1.9.4
Bug occurs on self-hosted PairDrop instance
Yes
Self-Hosted Setup
Proxy: Caddy
Deployment: docker-compose
Version: v1.9.4
Additional context
I have a vpn and all the services are under this vpn
The text was updated successfully, but these errors were encountered: