node-snapdrop
node-snapdrop copied to clipboard
Cross-device discovery doesn't work
I have the node server running on my Macbook pro. If I open it in a browser on the Macbook and on a handheld device by using the ip (in my case 192.168.0.258:3000) it works on both but they don't discover each other. If I open it in multiple tabs on either device, the different instances on one device discover each other, though.
@therobbot, this should be a common problem with Snapdrop with a lots and a lots of issues on the original repo. To resolve, just try to connect after a while. This also occurs to me sometimes. For now, I can't do anything, because no one, also me, understood what's wrong.
If there is some issue resolve on the original repo, I'll update this Node version.
@therobbot , I think I've hobbled together a patched version that fixes your issue.
Snapdrop is written from the assumption that the clients that are seeking to connect to each other are physically on the same LAN, BUT that lan is connected to the public internet where the snapdrop server is located. It is further assumed that the LAN is connected to the internet using NAT. Basically this means that, to the snapdrop server, it appears that all clients are originating from the same IP address.
In our case, however, the server will see unique IP addresses for each client seeking to connect to each other.
My fix is derived from this patch. This patch talks about needing a STUN server. My fix does not require any extra STUN server.
https://github.com/DrBassman/node-snapdrop/
Update: opened pull request, too.
@therobbot , I think I've hobbled together a patched version that fixes your issue.
Snapdrop is written from the assumption that the clients that are seeking to connect to each other are physically on the same LAN, BUT that lan is connected to the public internet where the snapdrop server is located. It is further assumed that the LAN is connected to the internet using NAT. Basically this means that, to the snapdrop server, it appears that all clients are originating from the same IP address.
In our case, however, the server will see unique IP addresses for each client seeking to connect to each other.
My fix is derived from this patch. This patch talks about needing a STUN server. My fix does not require any extra STUN server.
https://github.com/DrBassman/node-snapdrop/
Update: opened pull request, too.
By using node index.js LAN
,it works now.
Thank you!