Leonardo Scoppitto 0cd73f10ef Check for CF-Connecting-IP and decreased timeout
When hosting Snapdrop behind Cloudflare, X-Forwarded-For is useless. Furthermore, I'm hosting my installation behind another internal proxy, so, in the end, X-Forwarder-For is set to the internal proxy's IP for all the peer, which can see each other regardless being on different networks. To fix this I made _setIP check if the header "cf-connecting-ip" exists, then sets the IP accordingly.

Lastly, when a peer changes network (e.g. a phone switches from wifi to mobile data), the function _leaveRoom is not called and the peer stays visible to others connected to the same room for a whole minute: I adjusted the timeout to what I think is a more reasonable value (500ms, so _leaveRoom is called after 1s).
2022-11-24 13:51:39 +01:00
2022-11-08 19:14:25 +01:00
2022-10-23 06:17:39 +02:00
2020-07-14 22:12:10 +02:00
2022-11-18 20:21:48 +08:00
2020-07-14 22:14:40 +02:00
2020-07-14 22:41:41 +02:00
2019-06-16 11:03:21 +02:00
2022-11-08 19:14:55 +01:00

Snapdrop

Snapdrop: local file sharing in your browser. Inspired by Apple's Airdrop.

Snapdrop is built with the following awesome technologies:

Have any questions? Read our FAQ.

You can host your own instance with Docker.

Support the Snapdrop Community

Snapdrop is free. Still, we have to pay for the server. If you want to contribute, please use PayPal:

or Bitcoin:

CoinThx

Alternatively, you can become a Github Sponsor.

Thanks a lot for supporting free and open software!

Description
Languages
JavaScript 70.3%
HTML 16.1%
CSS 10.1%
Shell 3.4%
Dockerfile 0.1%